OS/우분투

우분투 18.04 Docker 설치

AKI 2019. 3. 29. 18:11

출처 : https://zetawiki.com/wiki/%EC%9A%B0%EB%B6%84%ED%88%AC16_docker_CE_%EC%84%A4%EC%B9%98


Docker 설치 확인 여부)

dev@dev-desktop:~$ docker -v

Command 'docker' not found, but can be installed with:

sudo snap install docker     # version 18.06.1-ce, or
sudo apt  install docker.io

See 'snap info docker' for additional versions.


설치 리스트 확인)

dev@dev-desktop:~$ apt list docker docker-engine docker.io
리스팅... 완료
docker/bionic 1.5-1build1 amd64
docker.io/bionic-updates 18.09.2-0ubuntu1~18.04.1 amd64


업데이트)

dev@dev-desktop:~$ sudo apt update


설치)

apt install

dev@dev-desktop:~$ sudo apt install apt-transport-https ca-certificates curl software-properties-common -y


apt-key

dev@dev-desktop:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
dev@dev-desktop:~$ apt-key fingerprint 0EBFCD88
pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]


add-apt-repository

dev@dev-desktop:~$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
받기:1 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
받기:2 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [5,673 B]
무시:3 http://dl.google.com/linux/chrome/deb stable InRelease                  
기존:4 http://kr.archive.ubuntu.com/ubuntu bionic InRelease                    
기존:5 http://kr.archive.ubuntu.com/ubuntu bionic-updates InRelease            
기존:6 http://kr.archive.ubuntu.com/ubuntu bionic-backports InRelease          
기존:7 http://dl.google.com/linux/chrome/deb stable Release                    
기존:8 http://ppa.launchpad.net/createsc/3beol/ubuntu bionic InRelease         
기존:9 http://security.ubuntu.com/ubuntu bionic-security InRelease             
기존:11 http://ppa.launchpad.net/hodong/nimf/ubuntu bionic InRelease           
내려받기 70.1 k바이트, 소요시간 1초 (56.3 k바이트/초)            
패키지 목록을 읽는 중입니다... 완료


dev@dev-desktop:~$ cat /etc/apt/sources.list | grep docker
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable


apt update

dev@dev-desktop:~$ sudo apt update


apt install

dev@dev-desktop:~$ sudo apt install docker-ce -y


버전확인)

dev@dev-desktop:~$ apt list docker-ce -a
리스팅... 완료
docker-ce/bionic,now 5:18.09.4~3-0~ubuntu-bionic amd64 [설치됨]###########..] 
docker-ce/bionic 5:18.09.3~3-0~ubuntu-bionic amd64########################..] 
docker-ce/bionic 5:18.09.2~3-0~ubuntu-bionic amd64
docker-ce/bionic 5:18.09.1~3-0~ubuntu-bionic amd64
docker-ce/bionic 5:18.09.0~3-0~ubuntu-bionic amd64
docker-ce/bionic 18.06.3~ce~3-0~ubuntu amd64
docker-ce/bionic 18.06.2~ce~3-0~ubuntu amd64
docker-ce/bionic 18.06.1~ce~3-0~ubuntu amd64
docker-ce/bionic 18.06.0~ce~3-0~ubuntu amd64
docker-ce/bionic 18.03.1~ce~3-0~ubuntu amd64

dev@dev-desktop:~$ docker -v
Docker version 18.09.4, build d14af54266



테스트)

dev@dev-desktop:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete 
Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

도커 서비스 실행여부확인)

dev@dev-desktop:~$ sudo systemctl status docker
[sudo] dev의 암호: 
 docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: e
   Active: active (running) since Fri 2019-03-29 18:08:18 KST; 5min ago
     Docs: https://docs.docker.com
 Main PID: 16384 (dockerd)
    Tasks: 15
   CGroup: /system.slice/docker.service
           └─16384 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/contai

 3월 29 18:08:17 dev-desktop dockerd[16384]: time="2019-03-29T18:08:17.684850708
 3월 29 18:08:17 dev-desktop dockerd[16384]: time="2019-03-29T18:08:17.684857922
 3월 29 18:08:17 dev-desktop dockerd[16384]: time="2019-03-29T18:08:17.685145865
 3월 29 18:08:17 dev-desktop dockerd[16384]: time="2019-03-29T18:08:17.843547850
 3월 29 18:08:17 dev-desktop dockerd[16384]: time="2019-03-29T18:08:17.996532912
 3월 29 18:08:18 dev-desktop dockerd[16384]: time="2019-03-29T18:08:18.098874685
 3월 29 18:08:18 dev-desktop dockerd[16384]: time="2019-03-29T18:08:18.099027868
 3월 29 18:08:18 dev-desktop dockerd[16384]: time="2019-03-29T18:08:18.158902775
 3월 29 18:08:18 dev-desktop systemd[1]: Started Docker Application Container En
 3월 29 18:09:29 dev-desktop dockerd[16384]: time="2019-03-29T18:09:29.762618582


















반응형