윈도우 11을 설치하니 ubuntu를 설치할 수 있었다. 

 

내친김에 도커를 만져보려고 한다. 

 

하나하나 밟아보자

 

설치된 ubuntu 버전은?

jkoogi@JKASUS:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
jkoogi@JKASUS:~$

저장소 설정

 

* apt-get 업데이트 :  책 가이드
 - sudo apt-get update

더보기

jkoogi@JKASUS:~$ sudo apt-get update
[sudo] password for jkoogi:
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:2 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1993 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [326 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [12.2 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1495 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [211 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [624 B]
Get:8 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [794 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [154 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [16.9 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.9 kB]
Hit:12 http://archive.ubuntu.com/ubuntu focal InRelease
Get:13 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5488 B]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [528 B]
Get:16 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2377 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [408 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.3 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1598 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [225 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [620 B]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1024 kB]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [237 kB]
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [23.5 kB]
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [25.2 kB]
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7408 B]
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [604 B]
Get:35 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
Get:36 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
Get:37 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
Get:38 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:39 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [24.9 kB]
Get:40 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
Get:41 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
Get:42 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 25.7 MB in 15s (1769 kB/s)
Reading package lists... Done
jkoogi@JKASUS:~$

* 블로그 가이드
https://shanepark.tistory.com/237

 

Ubuntu 20.04 LTS ) Docker 설치하기

Intro Docker는 제가 회사에서 사용하는 노트북의 OS를 Windows 에서 Ubuntu 로 변경하게 된 트리거 였습니다. Docker를 사용하면 정말 편하게 격리된 컨테이너들을 구성해 가상화의 장점을 정말 잘 살릴

shanepark.tistory.com

도커 설치는 책, 블로그 무시하고 도커사이트를 참고하자

https://docs.docker.com/engine/install/ubuntu/

 

 

Install Docker Engine on Ubuntu

 

docs.docker.com

* sudo apt update

더보기

jkoogi@JKASUS:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
189 packages can be upgraded. Run 'apt list --upgradable' to see them.
jkoogi@JKASUS:~$

* repository 를 이용하기 위해 pakcage 설치

sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
    
* ca-certificates : ca-certificate는 certificate authority에서 발행되는 디지털 서명. 
  SSL 인증서의 PEM 파일이 포함되어 있어 SSL 기반 앱이 SSL 연결이 되어있는지 확인가능.
* curl : 특정 웹사이트에서 데이터를 다운로드 받을 때 사용.
* (apt-transport-https : 패키지 관리자가 https를 통해 데이터 및 패키지에 접근할 수 있도록 한다.)
* (software-properties-common : *PPA를 추가하거나 제거할 때 사용.)

 

더보기

sudo apt-get install \
>     ca-ceca-certificates \
>     curl \
>     gnupg \
>     lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu2).
lsb-release set to manually installed.
The following additional packages will be installed:
  dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libcurl4
Suggested packages:
  pinentry-gnome3 tor parcimonie xloadimage scdaemon
The following packages will be upgraded:
  ca-certificates curl dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv
  libcurl4
14 upgraded, 0 newly installed, 0 to remove and 175 not upgraded.
Need to get 3100 kB of archives.
After this operation, 7168 B disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpg-wks-client amd64 2.2.19-3ubuntu2.2 [97.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 dirmngr amd64 2.2.19-3ubuntu2.2 [330 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpg-wks-server amd64 2.2.19-3ubuntu2.2 [90.2 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gnupg-utils amd64 2.2.19-3ubuntu2.2 [481 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpg-agent amd64 2.2.19-3ubuntu2.2 [232 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpg amd64 2.2.19-3ubuntu2.2 [482 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpgconf amd64 2.2.19-3ubuntu2.2 [124 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gnupg-l10n all 2.2.19-3ubuntu2.2 [51.7 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gnupg all 2.2.19-3ubuntu2.2 [259 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpgsm amd64 2.2.19-3ubuntu2.2 [217 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpgv amd64 2.2.19-3ubuntu2.2 [200 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ca-certificates all 20211016ubuntu0.20.04.1 [141 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.15 [161 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4 amd64 7.68.0-1ubuntu2.15 [235 kB]
Fetched 3100 kB in 6s (554 kB/s)
Preconfiguring packages ...
(Reading database ... 32289 files and directories currently installed.)
Preparing to unpack .../00-gpg-wks-client_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg-wks-client (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../01-dirmngr_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking dirmngr (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../02-gpg-wks-server_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg-wks-server (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../03-gnupg-utils_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gnupg-utils (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../04-gpg-agent_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg-agent (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../05-gpg_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../06-gpgconf_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgconf (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../07-gnupg-l10n_2.2.19-3ubuntu2.2_all.deb ...
Unpacking gnupg-l10n (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../08-gnupg_2.2.19-3ubuntu2.2_all.deb ...
Unpacking gnupg (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../09-gpgsm_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgsm (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../10-gpgv_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgv (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Setting up gpgv (2.2.19-3ubuntu2.2) ...
(Reading database ... 32289 files and directories currently installed.)
Preparing to unpack .../ca-certificates_20211016ubuntu0.20.04.1_all.deb ...
Unpacking ca-certificates (20211016ubuntu0.20.04.1) over (20210119~20.04.2) ...
Preparing to unpack .../curl_7.68.0-1ubuntu2.15_amd64.deb ...
Unpacking curl (7.68.0-1ubuntu2.15) over (7.68.0-1ubuntu2.7) ...
Preparing to unpack .../libcurl4_7.68.0-1ubuntu2.15_amd64.deb ...
Unpacking libcurl4:amd64 (7.68.0-1ubuntu2.15) over (7.68.0-1ubuntu2.7) ...
Setting up ca-certificates (20211016ubuntu0.20.04.1) ...
Updating certificates in /etc/ssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
7 added, 11 removed; done.
Setting up gnupg-l10n (2.2.19-3ubuntu2.2) ...
Setting up gpgconf (2.2.19-3ubuntu2.2) ...
Setting up libcurl4:amd64 (7.68.0-1ubuntu2.15) ...
Setting up curl (7.68.0-1ubuntu2.15) ...
Setting up gpg (2.2.19-3ubuntu2.2) ...
Setting up gnupg-utils (2.2.19-3ubuntu2.2) ...
Setting up gpg-agent (2.2.19-3ubuntu2.2) ...
Setting up gpgsm (2.2.19-3ubuntu2.2) ...
Setting up dirmngr (2.2.19-3ubuntu2.2) ...
Setting up gpg-wks-server (2.2.19-3ubuntu2.2) ...
Setting up gpg-wks-client (2.2.19-3ubuntu2.2) ...
Setting up gnupg (2.2.19-3ubuntu2.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for ca-certificates (20211016ubuntu0.20.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
jkoogi@JKASUS:~$ sudo apt-get install     ca-certificates     curl     gnupg     lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu2).
ca-certificates is already the newest version (20211016ubuntu0.20.04.1).
ca-certificates set to manually installed.
curl is already the newest version (7.68.0-1ubuntu2.15).
gnupg is already the newest version (2.2.19-3ubuntu2.2).
0 upgraded, 0 newly installed, 0 to remove and 175 not upgraded.
jkoogi@JKASUS:~$jkoogi@JKASUS:~$

* Docker의 공식 GPG 키를 추가

jkoogi@JKASUS:~$ sudo mkdir -m 0755 -p /etc/apt/keyrings
jkoogi@JKASUS:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

* 리포지토리를 설정 : stable repository 등록

jkoogi@JKASUS:~$ echo \
>   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
>   $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
jkoogi@JKASUS:~$
더보기

jkoogi@JKASUS:~$ sudo apt-key fingerprint
/etc/apt/trusted.gpg
--------------------
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]

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg
------------------------------------------------------
pub   rsa4096 2012-05-11 [SC]
      790B C727 7767 219C 42C8  6F93 3B4F E6AC C0B2 1F32
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg
------------------------------------------------------
pub   rsa4096 2012-05-11 [SC]
      8439 38DF 228D 22F7 B374  2BC0 D94A A3F0 EFE2 1092
uid           [ unknown] Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg
------------------------------------------------------
pub   rsa4096 2018-09-17 [SC]
      F6EC B376 2474 EDA9 D21B  7022 8719 20D1 991B C93C
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>

jkoogi@JKASUS:~$


* Docker Engine 설치

 - 오류?

jkoogi@JKASUS:~$ sudo apt-get update
Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Err:1 https://download.docker.com/linux/ubuntu focal InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
E: The repository 'https://download.docker.com/linux/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
jkoogi@JKASUS:~$

> 메뉴얼 스크립트 진행

jkoogi@JKASUS:~$ echo \
arch=$(>   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
>   $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
jkoogi@JKASUS:~$ sudo apt-get update
Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [24.5 kB]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Fetched 418 kB in 2s (189 kB/s)
Reading package lists... Done
jkoogi@JKASUS:~$

 


 

* Docker Engine, containerd 및 Docker Compose를 설치

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
더보기

jkoogi@JKASUS:~$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  docker-ce-rootless-extras docker-scan-plugin pigz slirp4netns
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite
The following NEW packages will be installed:
  containerd.io docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin
  docker-scan-plugin pigz slirp4netns
0 upgraded, 9 newly installed, 0 to remove and 175 not upgraded.
Need to get 111 MB of archives.
After this operation, 399 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.6.16-1 [27.7 MB]
Get:2 http://archive.ubuntu.com/ubuntu focal/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/universe amd64 slirp4netns amd64 0.4.3-1 [74.3 kB]
Get:4 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-buildx-plugin amd64 0.10.2-1~ubuntu.20.04~focal [25.9 MB]
Get:5 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-cli amd64 5:23.0.1-1~ubuntu.20.04~focal [13.2 MB]
Get:6 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce amd64 5:23.0.1-1~ubuntu.20.04~focal [22.0 MB]
Get:7 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-rootless-extras amd64 5:23.0.1-1~ubuntu.20.04~focal [8765 kB]
Get:8 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-compose-plugin amd64 2.16.0-1~ubuntu.20.04~focal [10.2 MB]
Get:9 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-scan-plugin amd64 0.23.0~ubuntu-focal [3622 kB]
Fetched 111 MB in 12s (9444 kB/s)
Selecting previously unselected package pigz.
(Reading database ... 32285 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.6.16-1_amd64.deb ...
Unpacking containerd.io (1.6.16-1) ...
Selecting previously unselected package docker-buildx-plugin.
Preparing to unpack .../2-docker-buildx-plugin_0.10.2-1~ubuntu.20.04~focal_amd64.deb ...
Unpacking docker-buildx-plugin (0.10.2-1~ubuntu.20.04~focal) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../3-docker-ce-cli_5%3a23.0.1-1~ubuntu.20.04~focal_amd64.deb ...
Unpacking docker-ce-cli (5:23.0.1-1~ubuntu.20.04~focal) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../4-docker-ce_5%3a23.0.1-1~ubuntu.20.04~focal_amd64.deb ...
Unpacking docker-ce (5:23.0.1-1~ubuntu.20.04~focal) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../5-docker-ce-rootless-extras_5%3a23.0.1-1~ubuntu.20.04~focal_amd64.deb ...
Unpacking docker-ce-rootless-extras (5:23.0.1-1~ubuntu.20.04~focal) ...
Selecting previously unselected package docker-compose-plugin.
Preparing to unpack .../6-docker-compose-plugin_2.16.0-1~ubuntu.20.04~focal_amd64.deb ...
Unpacking docker-compose-plugin (2.16.0-1~ubuntu.20.04~focal) ...
Selecting previously unselected package docker-scan-plugin.
Preparing to unpack .../7-docker-scan-plugin_0.23.0~ubuntu-focal_amd64.deb ...
Unpacking docker-scan-plugin (0.23.0~ubuntu-focal) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../8-slirp4netns_0.4.3-1_amd64.deb ...
Unpacking slirp4netns (0.4.3-1) ...
Setting up slirp4netns (0.4.3-1) ...
Setting up docker-scan-plugin (0.23.0~ubuntu-focal) ...
Setting up docker-buildx-plugin (0.10.2-1~ubuntu.20.04~focal) ...
Setting up containerd.io (1.6.16-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Setting up docker-compose-plugin (2.16.0-1~ubuntu.20.04~focal) ...
Setting up docker-ce-cli (5:23.0.1-1~ubuntu.20.04~focal) ...
Setting up pigz (2.4-1) ...
Setting up docker-ce-rootless-extras (5:23.0.1-1~ubuntu.20.04~focal) ...
Setting up docker-ce (5:23.0.1-1~ubuntu.20.04~focal) ...
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.
invoke-rc.d: could not determine current runlevel
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
jkoogi@JKASUS:~$

* 도커 확인
 - docker version

더보기

 jkoogi@JKASUS:~$ docker version
Client: Docker Engine - Community
 Version:           23.0.1
 API version:       1.42
 Go version:        go1.19.5
 Git commit:        a5ee5b1
 Built:             Thu Feb  9 19:46:56 2023
 OS/Arch:           linux/amd64
 Context:           default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
jkoogi@JKASUS:~$

* 오류 : 도커 실행이 안된다. WSL 우분투 환경에서 systemd 를 사용하지 않아서 발생하는 문제라고 한다.

jkoogi@JKASUS:/usr/sbin$ sudo apt-get install cgroupfs-mount
jkoogi@JKASUS:/usr/sbin$ sudo cgroupfs-mount
jkoogi@JKASUS:/usr/sbin$ sudo service docker start
더보기

jkoogi@JKASUS:/usr/sbin$ sudo apt-get install cgroupfs-mount
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  cgroupfs-mount
0 upgraded, 1 newly installed, 0 to remove and 175 not upgraded.
Need to get 6320 B of archives.
After this operation, 32.8 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 cgroupfs-mount all 1.4 [6320 B]
Fetched 6320 B in 0s (13.3 kB/s)
Selecting previously unselected package cgroupfs-mount.
(Reading database ... 32544 files and directories currently installed.)
Preparing to unpack .../cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Setting up cgroupfs-mount (1.4) ...
invoke-rc.d: could not determine current runlevel
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
jkoogi@JKASUS:/usr/sbin$ sudo cgroupfs-mount
jkoogi@JKASUS:/usr/sbin$ sudo service docker start
 * Starting Docker: docker                                                                                              [ OK ]
jkoogi@JKASUS:/usr/sbin$

참고 : https://otrodevym.tistory.com/entry/WSL-Docker-system-has-not-been-booted-with-systemd-as-init-system-pid-1-cant-operate

 

[WSL-Docker] system has not been booted with systemd as init system pid 1 cant operate

상황 WSL로 docker를 설치하고 실행하려고 했는데 에러가 발생했습니다. 문제 파악 /etc/init.d/docker로 실행하면 되지만 systemctl이나service로 실행하면 에러가 나는걸로 확인했고 블로그를 찾아보니 WSL

otrodevym.tistory.com

* 도커실행

 - sudo docker run hello-world

더보기

jkoogi@JKASUS:/usr/sbin$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:aa0cc8055b82dc2509bed2e19b275c8f463506616377219d9642221ab53cf9fe
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/

jkoogi@JKASUS:/usr/sbin$

+ Recent posts