ํ๋ฒ UTM์ ์ค์นํ ๊ฐ์๋จธ์ (VM) Ubuntu์ Docker Community Edition Version์ ํ๋ฒ ์ค์นํด ๋ณด๊ฒ ์ต๋๋ค.
Docker Community Edition ์ค์นํด๋ณด๊ธฐ (Terminal ver.)
Ubuntu์์ Terminal์ ์ฐ ๋ค์, ํ๋ฒ ์ค์นํด ๋ณด๊ฒ ์ต๋๋ค.
- ๋จผ์ , ํ์ฌ ์ฐ๋ถํฌ ๋ฒ์ ์ ํ์ธํด์ค๋๋ค.
cat /etc/lsb-release
toby@tobykakao:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
- ์ต์ ํจํค์ง๋ก ์ ๋ฐ์ดํธ๋ฅผ ์ํํด์ค๋๋ค.
sudo apt-get update
toby@tobykakao:~$ sudo apt-get update
- Docker ์ค์น๋ฅผ ์ํด Docker์ ์์กด์ฑ์ด ์๋ ํจํค์ง๋ค์ ๋ฏธ๋ฆฌ ์ค์นํด ์ฃผ๊ฒ ์ต๋๋ค.
sudo apt-get install -y
toby@tobykakao:~$ sudo apt-get install -y
- ๋์ปค์์ ์ ๊ณตํ๋ ๊ณต์ GPG key๋ฅผ ์ถ๊ฐํด์ค๋๋ค. GPG Key๋ apt๊ฐ ํจํค์ง๋ฅผ ์ธ์ฆํ ๋ ์ฌ์ฉํ๋ ํค ๋ฆฌ์คํธ๋ฅผ ๊ด๋ฆฌํฉ๋๋ค.
- apt-key๋ฅผ ํตํด ์ง์ ์ฌ์ดํธ์์ ์๋ก์ด ํค๋ฅผ ์ถ๊ฐํด์ค๋๋ค.
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- ์ถ๊ฐ๋ gpg-key ํ์ธ
/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-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>
- ์ถ๊ฐ๋ ํค์ค ์ฒซ๋ฒ์งธ ํค๋ฅผ ์ ํํ์ ํ๋ฒ ์กฐํํด ๋ณด๊ฒ ์ต๋๋ค.
sudo apt-key fingerprint 0EBFCD88
toby@tobykakao:~$ sudo apt-key fingerprint 0EBFCD88
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
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]
- Debian ๊ณ์ด์ Docker Repository PPA๋ฅผ ์ถ๊ฐํด์ฃผ๊ฒ ์ต๋๋ค.
- ์์ง ๋ฒ์ ์ค์น์ ๋ค์ ๊ตฌ๋ฌธ์ ๋ง์ง๋ง์ stable edge ์ถ๊ฐ ๋งค๋ฌ ๊ธฐ๋ฅ์ด ์ ๋ฐ์ดํธ ๋๋ ์์ง ๋ฒ์ ์ ๋ฒ๊ทธ ๋ฐ์ ๊ฐ๋ฅ์ฑ์ด ๋์ ์์ ํ (stable)๋ฒ์ ์ค์น๋ฅผ ๊ถ์ฅ๋๋ฆฝ๋๋ค.
echo "deb [arch=arm64 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
- ์ด์ , ์๋ก์ด ์ ์ฅ์๊ฐ ์ถ๊ฐ๋์์์ผ๋ก, ํจํค์ง ๋ชฉ๋ก์ ์ ๋ฐ์ดํธ ํด์ฃผ๊ฒ ์ต๋๋ค.
sudo apt-get update
- ํจํค์ง ๋ชฉ๋ก์ update ํด์คํ, Docker๋ฅผ ํ๋ฒ ์ค์นํด ์ฃผ๊ฒ ์ต๋๋ค.
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- ํ๋ฒ ์ค์นํ ์ ์ฅ์๋ฅผ ๋ณด๊ฒ ์ต๋๋ค.
apt-cache policy docker-ce
toby@tobykakao:~$ apt-cache policy docker-ce
docker-ce:
Installed: 5:27.3.1-1~ubuntu.24.04~noble
Candidate: 5:27.3.1-1~ubuntu.24.04~noble
Version table:
*** 5:27.3.1-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
100 /var/lib/dpkg/status
5:27.3.0-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.2.1-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.2.0-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.1.2-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.1.1-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.1.0-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.0.3-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.0.2-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:27.0.1-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.1.4-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.1.3-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.1.2-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.1.1-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.1.0-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.0.2-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.0.1-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
5:26.0.0-1~ubuntu.24.04~noble 500
500 https://download.docker.com/linux/ubuntu noble/stable arm64 Packages
- Docker Community Edition ์ค์น
sudo apt-get -y install docker-ce
toby@tobykakao:~$ sudo apt-get -y install docker-ce
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
docker-ce is already the newest version (5:27.3.1-1~ubuntu.24.04~noble).
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.
- Docker Version & Docker Demon ์ํ ํ์ธ
sudo docker version
toby@tobykakao:~$ sudo docker version
Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:41:54 2024
OS/Arch: linux/arm64
Context: default
Server: Docker Engine - Community
Engine:
Version: 27.3.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.7
Git commit: 41ca978
Built: Fri Sep 20 11:41:54 2024
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.7.22
GitCommit: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
runc:
Version: 1.1.14
GitCommit: v1.1.14-0-g2c9f560
docker-init:
Version: 0.19.0
GitCommit: de40ad0
sudo systemctl status docker
toby@tobykakao:~$ sudo systemctl status docker
\u25cf docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: e>
Active: active (running) since Tue 2024-10-08 06:29:22 UTC; 3min 12s ago
TriggeredBy: \u25cf docker.socket
Docs: https://docs.docker.com
Main PID: 6151 (dockerd)
Tasks: 12
Memory: 21.8M (peak: 25.3M)
CPU: 448ms
CGroup: /system.slice/docker.service
\u2514\u25006151 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont>
Oct 08 06:29:21 tobykakao dockerd[6151]: time="2024-10-08T06:29:21.949221604Z" >
Oct 08 06:29:21 tobykakao dockerd[6151]: time="2024-10-08T06:29:21.950768736Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.037603419Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.382201927Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.403118720Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.403148719Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.403166677Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.403251384Z" >
Oct 08 06:29:22 tobykakao dockerd[6151]: time="2024-10-08T06:29:22.443517170Z" >
Oct 08 06:29:22 tobykakao systemd[1]: Started docker.service - Docker Applicati>
lines 1-22/22 (END)
- ๋์ปค๋ ๊ถํ์ด ์๋ binary ์ด๊ธฐ ๋๋ฌธ์ ์คํ์ sudo๋ฅผ ๋ช ์ํ๊ณ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
- ๋ค์ ๋ช ๋ น์ docker group์ ํ์ฌ ์ฌ์ฉ์๋ฅผ ๊ทธ๋ฃน์ ์ถ๊ฐํ๋ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํฉ๋๋ค.
sudo usermod -aG docker $(whoami)
sudo systemctl restart docker
toby@tobykakao:~$ sudo usermod -aG docker $(whoami)
toby@tobykakao:~$ sudo systemctl restart docker
sudo systemctl status docker
toby@tobykakao:~$ sudo systemctl status docker
docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: e>
Active: active (running) since Tue 2024-10-08 06:34:50 UTC; 7s ago
TriggeredBy: \u25cf docker.socket
Docs: https://docs.docker.com
Main PID: 6561 (dockerd)
Tasks: 11
Memory: 19.9M (peak: 21.6M)
CPU: 412ms
CGroup: /system.slice/docker.service
\u2514\u25006561 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont>
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.116420790Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.116728745Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.539155870Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.615004596Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.630171766Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.630198557Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.630216474Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.630249098Z" >
Oct 08 06:34:50 tobykakao dockerd[6561]: time="2024-10-08T06:34:50.656755022Z" >
Oct 08 06:34:50 tobykakao systemd[1]: Started docker.service - Docker Applicati>
sudo systemctl status containerd.service
toby@tobykakao:~$ sudo systemctl status containerd.service \u25cf containerd.service - containerd container runtime Loaded: loaded (/usr/lib/systemd/system/containerd.service; enabled; prese> Active: active (running) since Tue 2024-10-08 06:29:21 UTC; 6min ago Docs: https://containerd.io Main PID: 5818 (containerd) Tasks: 11 Memory: 12.9M (peak: 14.2M) CPU: 883ms CGroup: /system.slice/containerd.service \u2514\u25005818 /usr/bin/containerd Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003640444> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003647236> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003653944> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003659402> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003666860> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003673360> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003832273> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003867731> Oct 08 06:29:21 tobykakao containerd[5818]: time="2024-10-08T06:29:21.003921563> Oct 08 06:29:21 tobykakao systemd[1]: Started containerd.service - containerd c>
- ๋ง์ฝ ์ฌ๊ธฐ์ permission denied๊ฐ ๋ด๋ค๋ฉด? → ์ธ์ ์์๋ ๋ณ๊ฒฝ์ฌํญ์ด ์ ์ฉ์ด ์๋์ด ์์์๋ ์์ต๋๋ค.
- ์ด๋, newgrp ๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ์ฌ ๋ณ๊ฒฝ์ฌํญ์ ์ฆ์ ์ ์ฉํฉ๋๋ค.
toby@tobykakao:~$ docker version
Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:41:54 2024
OS/Arch: linux/arm64
Context: default
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/version": dial unix /var/run/docker.sock: connect: permission denied
newgrp docker
- ๊ทธ๋ฌ๋ฉด ์ด์ ๋ก๊ทธ์ธ์ด ๋๊ฑธ ์์ ์์ต๋๋ค, ์ด์ ๊ณ์ ์ ๋ก๊ทธํ์ ํ๊ณ ๋ค์ ๋ก๊ทธ์ธํ ํ๋ก๋ถํฐ sudo ์์ด๋ docker ๋ช ๋ น์ด ์ฌ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค.
toby@tobykakao:~$ docker version
Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:41:54 2024
OS/Arch: linux/arm64
Context: default
Server: Docker Engine - Community
Engine:
Version: 27.3.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.7
Git commit: 41ca978
Built: Fri Sep 20 11:41:54 2024
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.7.22
GitCommit: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
runc:
Version: 1.1.14
GitCommit: v1.1.14-0-g2c9f560
docker-init:
Version: 0.19.0
GitCommit: de40ad0
- ์ฌ๊ธฐ์ ์ถ๊ฐ ๊ตฌ์ฑ์์ ์ผ๋ก ๋ณด์ ์ค์ ๋ชจ๋์ธ SELinux๋ผ๊ณ ์์ต๋๋ค.
- ๋์ปค ์ฌ์ฉ ๊ณผ์ ์์ Permission Denied ๊ฐ์ ๊ถํ ๊ฑฐ๋ถ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ์ด๊ฒ์ ๋ฐฉ์งํ๊ธฐ ์ํด์๋ ํ์ฌ SELinux ์ค์ ๊ฐ์ ํธ๊ฐ์ธํด๋ณด๊ณ enforcing ๋ชจ๋๋ผ๋ฉด permissive ๋ชจ๋๋ก ๋ณ๊ฒฝํฉ๋๋ค.
- ๊ฐ์ ๋ชจ๋ (enforcing mode) ์ํ์์๋ ๋ณด์ ๊ธฐ๋ฅ์ ๊ฐ์ง๊ณ ์๋ SELinux ์ ์ฑ ์ด ํ์ฑํ๋์ด ๊ฐ์ ์ ์ผ๋ก ๊ทธ ์ ์ฑ ์ ๋ฐ๋ฅด๊ฒ ํ์ฌ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. ํ์ฉ๋ชจ๋ (permissive mode)๋ก ์ค์ ํ๋ฉด ์ ๊ทผ ์ ์ด ์๋ฐ ๋ฐ์ ์ ๋ก๊ทธ ๊ธฐ๋ก๋ง ์ํํ๊ณ ๊ฐ์ ์ข ๋ฃ(์ค๋ฅ)ํ์ง ์์ต๋๋ค.
- SELinux ์คํ ๋ชจ๋ ํ์ธ
toby@tobykakao:~$ sestatus
- ๋ง์ฝ enforcing์ด ๋์ด ์๋ค๋ฉด? ์๋์ ๋ช ๋ น์ด๋ฅผ ์ํํด์ ๋ณ๊ฒฝํฉ๋๋ค.
# permissive mode(0), enforcing mode(1)
toby@tobykakao:~$ sudo sentenforce 0
Docker Community Edition ์ค์นํด๋ณด๊ธฐ (Script ver.)
Docker ์น์ฌ์ดํธ์์ ์ง๊ณตํ๋ ์คํฌ๋ฆฝํธ๋ฅผ ์ด์ฉํ์ฌ ๊ฐ๋จํ๊ฒ docker-ce๋ฅผ ์ค์น ํ ์ ์์ต๋๋ค.
curl -fsSL https://get.docker.com -o get-docker.sh
vi get-docker.sh
# docker ์๋์ค์น shell script
toby@tobykakao:~$ curl -fsSL https://get.docker.com -o get-docker.sh
toby@tobykakao:~$ vi get-docker.sh
- ์ด๋ ๊ฒ ์๋์ ๋จ๋ script ์์๋๋ก ํฐ๋ฏธ๋์ฐฝ์ ์ด์ด์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํด์ฃผ๋ฉด ๋ฉ๋๋ค.
# To install the latest stable versions of Docker CLI, Docker Engine, and their
# dependencies:
#
# 1. download the script
#
# $ curl -fsSL https://get.docker.com -o install-docker.sh
#
# 2. verify the script's content
#
# $ cat install-docker.sh
#
# 3. run the script with --dry-run to verify the steps it executes
#
# 4. run the script either as root, or using sudo to perform the installation.
#
# $ sudo sh install-docker.sh
- ๊ทธ๋ฆฌ๊ณ , ์ ์คํฌ๋ฆฝํธ ์ด๋ฏ๋ก ์คํ ๊ถํ์ด ํ์ํฉ๋๋ค.
# ์
์คํฌ๋ฆฝํธ ์ด๋ฏ๋ก ์คํ ๊ถํ ํ์. x(execute) ๊ถํ ๋ถ์ฌ
chmod +x get-docker.sh
- ์คํ ๊ถํ์ ๋ถ์ฌ ํ ํ, ๋์ปค ์๋ ์ค์น ์ ์คํฌ๋ฆฝํธ์ ์คํํฉ๋๋ค.
sudo sh get-docker.sh
- ๋์ปค ๋ฒ์ ์ ํ์ธํฉ๋๋ค.
# ๋์ปค ๋ฒ์ ํ์ธ
toby@tobykakao:~$ docker version
Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:41:54 2024
OS/Arch: linux/arm64
Context: default
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/version": dial unix /var/run/docker.sock: connect: permission denied
- ๋จ์ฝ permission denied๊ฐ ๋จ๋ฉด?
1. ํ์ฌ ์ฌ์ฉ์ Docker ๊ทธ๋ฃน์ ์ถ๊ฐ ํ์ธ
"permission denied" ์ค๋ฅ๋ ํ์ฌ ์ฌ์ฉ์๊ฐ Docker ๊ทธ๋ฃน์ ์ถ๊ฐ๋์์ง๋ง, ๋ณ๊ฒฝ ์ฌํญ์ด ์์ง ์ ์ฉ๋์ง ์์๊ฑฐ๋ Docker ๋ฐ๋ชฌ์ ์ ๊ทผํ ๊ถํ์ด ์์ด์ ๋ฐ์ํ๋ ๋ฌธ์ ์ ๋๋ค.
- ํ์ฌ ์ฌ์ฉ์ Docker ๊ทธ๋ฃน์ ์ถ๊ฐ ํ์ธ: ๋จผ์ ํ์ฌ ์ฌ์ฉ์๊ฐ Docker ๊ทธ๋ฃน์ ์ ๋๋ก ์ถ๊ฐ๋์๋์ง ํ์ธํฉ๋๋ค.
groups $(whoami)
- ์ฌ๊ธฐ์ docker ๊ทธ๋ฃน์ด ๋์ด๋์ด ์์ด์ผ ํฉ๋๋ค. ๋ง์ฝ ๋์ด๋์ด ์์ง ์๋ค๋ฉด, ๋ค์ ๋ช ๋ น์ด๋ก ์ฌ์ฉ์๋ฅผ ๋ค์ ์ถ๊ฐํ์ธ์.
sudo usermod -aG docker $(whoami)
2. ์ธ์ ์ฌ์์
- ์ฌ์ฉ์๊ฐ Docker ๊ทธ๋ฃน์ ์ถ๊ฐ๋ ํ์๋ ๊ธฐ์กด ์ธ์ ์์๋ ๋ณ๊ฒฝ ์ฌํญ์ด ๋ฐ์๋์ง ์์ผ๋ฏ๋ก ๋ก๊ทธ์์ํ๋ค๊ฐ ๋ค์ ๋ก๊ทธ์ธํด์ผ ํฉ๋๋ค. ๋๋ ์๋ ๋ช ๋ น์ด๋ก ์ธ์ ์ ์ฌ์์ํ ์ ์์ต๋๋ค.
newgrp docker
3. Docker ๋ฐ๋ชฌ์ด ์คํ ์ค์ธ์ง ํ์ธ
- Docker ๋ฐ๋ชฌ์ด ์ ๋๋ก ์คํ ์ค์ธ์ง ํ์ธํด์ผ ํฉ๋๋ค. ๋ฐ๋ชฌ์ด ์ค์ง๋์ด ์์ผ๋ฉด ๊ถํ์ด ์์ด๋ ์ฐ๊ฒฐ์ด ์ ๋ ์ ์์ต๋๋ค.
sudo systemctl status docker
- Docker ๋ฐ๋ชฌ์ด ์ค์ง๋์ด ์์ผ๋ฉด, ๋ค์ ๋ช ๋ น์ด๋ก ์์ํฉ๋๋ค.
sudo systemctl start docker
4. Docker ๋ช ๋ น์ด ์ฌ์คํ
- ๋ณ๊ฒฝ ์ฌํญ์ ์ ์ฉํ ํ ๋ค์ docker version ๋ช ๋ น์ด๋ฅผ ์คํํด๋ด ๋๋ค. ์๋จ๊ณ๋ฅผ ๋ชจ๋ ์ํํ๋ฉด Docker ๊ถํ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋๊ณ ์ ์์ ์ผ๋ก ์๋ํ ๊ฒ์ ๋๋ค.
docker version
๊ทธํ, apt๋ฅผ ํตํด ์ค์นํ Docker๋ฅผ ์ ๊ฑฐํฉ๋๋ค.
sudo apt purge docker-ce
toby@tobykakao:~$ sudo apt purge docker-ce
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
pigz
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
docker-ce*
0 upgraded, 0 newly installed, 1 to remove and 31 not upgraded.
After this operation, 79.4 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 166965 files and directories currently installed.)
Removing docker-ce (5:27.3.1-1~ubuntu.24.04~noble) ...
(Reading database ... 166956 files and directories currently installed.)
Purging configuration files for docker-ce (5:27.3.1-1~ubuntu.24.04~noble) ...
๋ํ ๊ด๋ จ Directory๋ ์ญ์ ํฉ๋๋ค.
toby@tobykakao:~$ sudo rm -rf /var/lib/docker
ps. ๊ทธ๋ฌ๋ฉด ๋ค์๊ธ์์ Docker๊ฐ ์ ์์ ์ผ๋ก ์ค์น๊ฐ ๋์๋์ง ํ์ธํ๋ ๋ด์ฉ์ ๊ฐ์ง๊ณ ๋์์ค๊ฒ ์ต๋๋ค.
'โ๏ธ Cloud Native > ๐ณ Docker' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Docker] Docker Container ๋ช ๋ น์ด (with Ngnix Container ์คํ) (0) | 2024.11.05 |
---|---|
[Docker] Docker ๋ช ๋ น์ด ํ์ฉ Part.2 (0) | 2024.10.31 |
[Docker] Docker ๋ช ๋ น์ด ํ์ฉ Part.1 (0) | 2024.10.31 |
[Docker] Docker Installation Check (๋์ปค ์ค์น ํ์ธ) (0) | 2024.10.11 |
[Docker] Docker Install (๋์ปค ์ค์น with UTM, Ubuntu install) (0) | 2024.10.07 |