Docker μ¬μ©μ μν κΈ°λ³Έμ μΈ μ€μΉ λ°©λ² λ©λͺ¨
0. μ΄μ λ²μ μ κ±° (μ ν)
- μ§ν μ€μΈ Docker κ΄λ ¨ μμ μ΄ μμ΄, prune λͺ λ Ήμ΄λ₯Ό ν΅ν΄ κΈ°μ‘΄ Dockerμ 리μμ€λ€μ μμ μ§ννμμ΅λλ€.
docker system prune -a

- 곡μ λ¬Έμμ λ°λΌ, μλ 컀맨λλ‘ μμ λ₯Ό μ§νν©λλ€.
(κ²Έμ¬κ²Έμ¬
autoremoveλ μ§νν©λλ€.)
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt-get autoremove
# β― for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# [sudo] password for kkumtree:
# Reading package lists... Done
# Building dependency tree... Done
# Reading state information... Done
# The following packages were automatically installed and are no longer required:
# bridge-utils containerd pigz runc ubuntu-fan
# Use 'sudo apt autoremove' to remove them.
# The following packages will be REMOVED:
# docker.io
# 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
# After this operation, 126 MB disk space will be freed.
# Do you want to continue? [Y/n] Y
# (Reading database ... 465886 files and directories currently installed.)
# Removing docker.io (27.5.1-0ubuntu3~24.04.2) ...
# '/usr/share/docker.io/contrib/nuke-graph-directory.sh' -> '/var/lib/docker/nuke-graph-directory.sh'
# Stopping 'docker.service', but its triggering units are still active:
# docker.socket
# Processing triggers for man-db (2.12.0-4build2) ...
# (...)
# Removing containerd (1.7.28-0ubuntu1~24.04.1) ...
# Processing triggers for man-db (2.12.0-4build2) ...
# Reading package lists... Done
# Building dependency tree... Done
# Reading state information... Done
# The following packages were automatically installed and are no longer required:
# bridge-utils pigz ubuntu-fan
# Use 'sudo apt autoremove' to remove them.
# The following packages will be REMOVED:
# runc
# 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
# After this operation, 34.3 MB disk space will be freed.
# Do you want to continue? [Y/n] Y
# (Reading database ... 465640 files and directories currently installed.)
# Removing runc (1.3.0-0ubuntu2~24.04.1) ...
# Processing triggers for man-db (2.12.0-4build2) ...
# β― sudo apt-get autoremove
# Reading package lists... Done
# Building dependency tree... Done
# Reading state information... Done
# The following packages will be REMOVED:
# bridge-utils pigz ubuntu-fan
# 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
# After this operation, 421 kB disk space will be freed.
# Do you want to continue? [Y/n] Y
# (Reading database ... 465612 files and directories currently installed.)
# Removing ubuntu-fan (0.12.16+24.04.1) ...
# ubuntu-fan: removing default /etc/network/fan configuration
# Removing bridge-utils (1.7.1-1ubuntu2) ...
# Removing pigz (2.8-1) ...
# Processing triggers for man-db (2.12.0-4build2) ...
1. Docker 곡μ GPG keyμ APT λ ν¬μ§ν 리 μΆκ°
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

2. Docker ν¨ν€μ§λ₯Ό μ€μΉν©λλ€
(1) μ΅μ λ²μ
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
(2) νΉμ λ²μ
- APT repositoryμμ λ°μ μ μλ λ²μ μ μ‘°νν©λλ€.
# List the available versions:
apt-cache madison docker-ce | awk '{ print $3 }'
# β― apt-cache madison docker-ce | awk '{ print $3 }'
# 5:28.5.1-1~ubuntu.24.04~noble
# 5:28.5.0-1~ubuntu.24.04~noble
# 5:28.4.0-1~ubuntu.24.04~noble
# 5:28.3.3-1~ubuntu.24.04~noble
# 5:28.3.2-1~ubuntu.24.04~noble
# 5:28.3.1-1~ubuntu.24.04~noble
# 5:28.3.0-1~ubuntu.24.04~noble
# (...)
- μ΄ν, μνλ λ²μ μ νκ²½λ³μλ‘ μ€μ νμ¬ μ€μΉν©λλ€.
VERSION_STRING=5:28.5.1-1~ubuntu.24.04~noble
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
3. κΆν μμΉ μ€μ (μ ν)
docker κ·Έλ£Ήμ μ¬μ©μμκ² λ£¨νΈ μμ€μ κΆνμ λΆμ¬ν©λλ€. https://docs.docker.com/engine/security/#docker-daemon-attack-surface
sudo groupadd docker
sudo usermod -aG docker $USER
- λ‘κ·Έμμ, νΉμ μλ‘μ΄ ν°λ―Έλμμ μ μν©λλ€.
νΉμ μλ 컀맨λλ‘ κ·Έλ£Ήμ νμ±νν μ μμ΅λλ€.
newgrp docker
9. WARNING: Error loading config file (Troubleshooting)
# WARNING: Error loading config file: /home/user/.docker/config.json -
# stat /home/user/.docker/config.json: permission denied
- μ΄ μ€λ₯λ
sudoλͺ λ Ήμ μ΄μ μ μ¬μ©νκΈ° λλ¬Έμ~/.docker/λλ ν°λ¦¬μ λν κΆν μ€μ μ΄ μλͺ»λμμμ λνλ λλ€.
~/.docker/λλ ν°λ¦¬λ₯Ό μ κ±°νκ±°λ(μλ μμ±λμ§λ§, μ¬μ©μ μ§μ μ€μ μ μμ λ©λλ€.)- μλμ κ°μ΄, μμ κΆ λ° κΆνμ λ³κ²½ν©λλ€.
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R
Reference
kkumtree
Source code on GitHub
Β© 2025 kkumtree and contributors All rights reserved.
Licensed under
CC BY-NC-ND 4.0