ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Docker] Docker 삭제 후 재 설치하기
    Linux/Tools 2024. 8. 9. 18:15

    1. 컨테이너 삭제

    docker rm -f $(docker ps -qa)

     

    2. 도커 삭제

    sudo apt-get purge docker-ce docker-ce-cli containerd.io
    sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli
    sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce

     

    3. 폴더 삭제

    sudo rm -rf /var/lib/docker
    sudo rm -rf /var/run/docker.sock
    sudo rm -rf ~/.docker
    sudo rm -rf /etc/docker
    sudo rm -rf /usr/local/bin/docker-compose
    sudo rm -rf /var/lib/docker /etc/docker

     

    4. 그룹 삭제(재설치시 삭제 안해도 됨)

    sudo groupdel docker

     

    5. 설치

    # Add Docker's official GPG key:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Designed by Tistory.