Ubuntu 18 docker 설치 방법

각 명령어를 순차로 입력

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce

docker-ce 설치 이후 상태 확인을 해봅시다

sudo systemctl status docker
출력되는 메세지의 최 좌상단의 동그라미 가 green 이면서 active : running 이라면 docker 가 정상 구동중 입니다

각 명령어별 결과 화면까지를 모두 포함해서 보면 이렇습니다

root@yj_ubuntu18:~# apt update
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1,845 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-security/main Translation-en [338 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1,136 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [258 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [20.9 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [4,732 B]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,191 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [430 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,747 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [374 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [27.3 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [6,808 B]
Fetched 8,555 kB in 6s (1,433 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
246 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@yj_ubuntu18:~# apt install apt-transport-https ca-certificates curl software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  libcurl4 libssl1.1 python3-software-properties
The following NEW packages will be installed:
  apt-transport-https
The following packages will be upgraded:
  ca-certificates curl libcurl4 libssl1.1 python3-software-properties software-properties-common
6 upgraded, 1 newly installed, 0 to remove and 240 not upgraded.
Need to get 1,864 kB of archives.
After this operation, 691 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 ca-certificates all 20210119~18.04.1 [147 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.1-1ubuntu2.1~18.04.10 [1,301 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 apt-transport-https all 1.6.14 [4,348 B]
Get:4 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 curl amd64 7.58.0-2ubuntu3.14 [159 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 libcurl4 amd64 7.58.0-2ubuntu3.14 [219 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 software-properties-common all 0.96.24.32.14 [10.1 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 python3-software-properties all 0.96.24.32.14 [23.9 kB]
Fetched 1,864 kB in 4s (480 kB/s)
Preconfiguring packages ...
(Reading database ... 103987 files and directories currently installed.)
Preparing to unpack .../0-ca-certificates_20210119~18.04.1_all.deb ...
Unpacking ca-certificates (20210119~18.04.1) over (20180409) ...
Preparing to unpack .../1-libssl1.1_1.1.1-1ubuntu2.1~18.04.10_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.10) over (1.1.0g-2ubuntu4.3) ...
Selecting previously unselected package apt-transport-https.
Preparing to unpack .../2-apt-transport-https_1.6.14_all.deb ...
Unpacking apt-transport-https (1.6.14) ...
Preparing to unpack .../3-curl_7.58.0-2ubuntu3.14_amd64.deb ...
Unpacking curl (7.58.0-2ubuntu3.14) over (7.58.0-2ubuntu3.7) ...
Preparing to unpack .../4-libcurl4_7.58.0-2ubuntu3.14_amd64.deb ...
Unpacking libcurl4:amd64 (7.58.0-2ubuntu3.14) over (7.58.0-2ubuntu3.7) ...
Preparing to unpack .../5-software-properties-common_0.96.24.32.14_all.deb ...
Unpacking software-properties-common (0.96.24.32.14) over (0.96.24.32.9) ...
Preparing to unpack .../6-python3-software-properties_0.96.24.32.14_all.deb ...
Unpacking python3-software-properties (0.96.24.32.14) over (0.96.24.32.9) ...
Setting up apt-transport-https (1.6.14) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.10) ...
Checking for services that may need to be restarted...done.
Checking for services that may need to be restarted...done.
Checking init scripts...

Restarting services possibly affected by the upgrade:

Services restarted successfully.

Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up python3-software-properties (0.96.24.32.14) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...
Setting up ca-certificates (20210119~18.04.1) ...
Updating certificates in /etc/ssl/certs...
23 added, 27 removed; done.
Setting up software-properties-common (0.96.24.32.14) ...
Setting up libcurl4:amd64 (7.58.0-2ubuntu3.14) ...
Setting up curl (7.58.0-2ubuntu3.14) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for ca-certificates (20210119~18.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
root@yj_ubuntu18:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo: unable to resolve host yj_ubuntu18: Resource temporarily unavailable
OK
root@yj_ubuntu18:~# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo: unable to resolve host yj_ubuntu18: Resource temporarily unavailable
Get:1 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Get:2 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [19.8 kB]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Fetched 84.3 kB in 1s (65.3 kB/s)
Reading package lists... Done
root@yj_ubuntu18:~# apt update
Hit:1 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
240 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@yj_ubuntu18:~# apt-cache policy docker-ce
docker-ce:
  Installed: (none)
  Candidate: 5:20.10.8~3-0~ubuntu-bionic
  Version table:
     5:20.10.8~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.7~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.6~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.5~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.4~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.3~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.2~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.1~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:20.10.0~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.15~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.14~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.13~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.12~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.11~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.10~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.9~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.8~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.7~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.6~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.5~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.4~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.3~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.2~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.1~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:19.03.0~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.9~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.8~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.7~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.6~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.5~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.4~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.3~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.2~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.1~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     5:18.09.0~3-0~ubuntu-bionic 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     18.06.3~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     18.06.2~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     18.06.1~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     18.06.0~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
     18.03.1~ce~3-0~ubuntu 500
        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
root@yj_ubuntu18:~# apt install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  grub-pc-bin
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  containerd.io docker-ce-cli docker-ce-rootless-extras docker-scan-plugin libltdl7 pigz
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite
Recommended packages:
  slirp4netns
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-scan-plugin libltdl7 pigz
0 upgraded, 7 newly installed, 0 to remove and 240 not upgraded.
Need to get 96.7 MB of archives.
After this operation, 407 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://download.docker.com/linux/ubuntu bionic/stable amd64 containerd.io amd64 1.4.9-1 [24.7 MB]
Get:2 http://archive.ubuntu.com/ubuntu bionic/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:3 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce-cli amd64 5:20.10.8~3-0~ubuntu-bionic [38.8 MB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libltdl7 amd64 2.4.6-2 [38.8 kB]
Get:5 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 5:20.10.8~3-0~ubuntu-bionic [21.2 MB]
Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce-rootless-extras amd64 5:20.10.8~3-0~ubuntu-bionic [7,911 kB]
Get:7 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-scan-plugin amd64 0.8.0~ubuntu-bionic [3,888 kB]
Fetched 96.7 MB in 3s (34.9 MB/s)
Selecting previously unselected package pigz.
(Reading database ... 103988 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../1-containerd.io_1.4.9-1_amd64.deb ...
Unpacking containerd.io (1.4.9-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../2-docker-ce-cli_5%3a20.10.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce-cli (5:20.10.8~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../3-docker-ce_5%3a20.10.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce (5:20.10.8~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../4-docker-ce-rootless-extras_5%3a20.10.8~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce-rootless-extras (5:20.10.8~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-scan-plugin.
Preparing to unpack .../5-docker-scan-plugin_0.8.0~ubuntu-bionic_amd64.deb ...
Unpacking docker-scan-plugin (0.8.0~ubuntu-bionic) ...
Selecting previously unselected package libltdl7:amd64.
Preparing to unpack .../6-libltdl7_2.4.6-2_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.6-2) ...
Setting up containerd.io (1.4.9-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Processing triggers for ureadahead (0.100.0-21) ...
Setting up docker-ce-rootless-extras (5:20.10.8~3-0~ubuntu-bionic) ...
Setting up docker-scan-plugin (0.8.0~ubuntu-bionic) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.21) ...
Setting up libltdl7:amd64 (2.4.6-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up docker-ce-cli (5:20.10.8~3-0~ubuntu-bionic) ...
Setting up pigz (2.4-1) ...
Setting up docker-ce (5:20.10.8~3-0~ubuntu-bionic) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.21) ...
root@yj_ubuntu18:~# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-08-23 12:47:17 KST; 6s ago
     Docs: https://docs.docker.com
 Main PID: 10316 (dockerd)
    Tasks: 8
   CGroup: /system.slice/docker.service
           └─10316 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Aug 23 12:47:16 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:16.906470546+09:00" level=info msg=
Aug 23 12:47:16 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:16.995017247+09:00" level=warning m
Aug 23 12:47:16 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:16.995050051+09:00" level=warning m
Aug 23 12:47:16 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:16.995468898+09:00" level=info msg=
Aug 23 12:47:17 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:17.190839021+09:00" level=info msg=
Aug 23 12:47:17 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:17.358846737+09:00" level=info msg=
Aug 23 12:47:17 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:17.390748947+09:00" level=info msg=
Aug 23 12:47:17 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:17.390939469+09:00" level=info msg=
Aug 23 12:47:17 yj_ubuntu18 systemd[1]: Started Docker Application Container Engine.
Aug 23 12:47:17 yj_ubuntu18 dockerd[10316]: time="2021-08-23T12:47:17.442863246+09:00" level=info msg=

[1]+  Stopped                 systemctl status docker

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다