cmd 창에서 ssh root@'서버 IP' -p '포토번호' 와 자신이 설정한 PW를 입력해 서버 접속
접속 후 다음과 같이 코드 입력
# Uninstall old versions
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
# Set up the repository
# Install the yum-utils package (which provides the yum-config-manager utility) and set up the repository.
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Install Docker engine.
yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Start Docker.
systemctl start docker
systemctl enable docker
# Verify that the Docker Engine installation is successful by running the hello-world image.
docker run hello-world
도커 설치 완료가 되면 systemctl status docker 를 입력해 도커가 잘 돌아가고 있는지 확인
위와 같이 녹색불 뜨면 성공, 빨간색 실패
도커 정지하는 방법
systemctl stop docker
도커 시작
systemctl start docker
도커 재시작
systemctl restart docker
재부팅 시 자동으로 도커 실행
systemctl enable docker
자동에서 수동 변화
systemctl disable docker
컨테이너 삭제
docker rm -f $(docker ps -qa)
이미지 삭제
docker rmi -f $(docker images -qa)
안쓰는 네트워크 삭제
docker network prune -f
안쓰는 볼륨 삭제
docker volume prune -f
도커 프로젝트 삭제
rm -rf /docker_projects