개발하는 두부

[Docker] Install Docker (Ubuntu)

by 뚜부니

Docker logo

▶ Uninstall old versions

docker, docker.io 또는 docker-engine과 같은 오래된 버전은 아래 명령으로 지운다.

기존 이미지, 컨테이너, 볼륨 및 네트워크를 포함한 콘텐츠들은 /var/lib/docker/directory에 보존되기 때문에 지워도 괜찮다.

sudo apt-get remove docker docker-engine docker.io containerd runc

기존에 설치된 도커가 없는 경우

 

▶Install Docker Engine

 

Docker CE를 설치하기 전에 먼저 도커 저장소인 repository를 설정해야 한다. 그 후 저장소로부터 도커를 설치하거나 업데이트 할 수 있다.

 

- Install using the repositor

1. Update the apt package index:

$ sudo apt-get update

2. Install packages to allow apt to use a repository over HTTPS :

$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

3. Add Docker's official GPG key :

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

4. Use the following command to set up the stable repository. To add the nlghtly or test repository, add the word nightly or test after the word stable in the commands below. (x86_64/amd64)

$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

 

- Install Docker Engine - Community

1. Update the apt package index :

$ sudo apt-get update

2.  Install the latest version of Docker Engine - Community and containerd

$ sudo apt-get install docker-ce

3. Verify that Docker Engine - Community is installed correctly by running the hello-world image

$ sudo docker run hello-world

 

 


🔗Reference

 

'Infra > Docker&K8S' 카테고리의 다른 글

[Docker] Windows에 Docker 설치하기  (0) 2021.07.06
[Kubernetes] What is Kubernetes?  (0) 2020.04.21
[Docker] What is Docker?  (0) 2020.04.13

블로그의 정보

개발하는 두부

뚜부니

활동하기