Docker

VSCode DevContainer - CI/CD ์Šคํ„ฐ๋”” 1์ฃผ์ฐจ

  • kkumtree

2025-10-19T20:50:46+09:00

ํ•œ๊ฐ€์œ„ ์—ฐํœด์˜ ๋๊ณผ ํ•จ๊ป˜, CloudNet@์—์„œ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋Š” CI/CD Study์— ์ฐธ์—ฌํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ์—๋Š” ํ•ธ์ฆˆ์˜จ์šฉ์œผ๋กœ ์ฆ๊ฒจ์“ฐ๋Š” GitHub CodeSpace์™€ ์—ฐ๊ด€๋œ,
Visual Studio ์ƒ์—์„œ์˜ Dev Containers ํ™œ์šฉ์— ๋Œ€ํ•ด ๋‹ค๋ค„๋ณด๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ OSํ™˜๊ฒฝ์€ Ubuntu Desktop 24.04 LTS ์ด๋ฉฐ,
์•„๋ž˜์˜ ๋ฌธ์„œ์—์„œ ์•ˆ๋‚ด๋œ๋Œ€๋กœ ์ฐจ๊ทผ์ฐจ๊ทผ ๋”ฐ๋ผํ•ด๋ณด๋ฉฐ ์ข€ ๋” ์ดํ•ด๋ฅผ ํ•ด๋ณด๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

Developing inside a Container

0. Docker ์„ค์น˜

๋‚ด์šฉ์ด ๊ธธ์–ด, ์•„๋ž˜์˜ ํฌ์ŠคํŠธ๋กœ ๋‚˜๋ˆ„์—ˆ์Šต๋‹ˆ๋‹ค.

  • Ubuntu Docker ์„ค์น˜
  • ์ž‘์„ฑ ๊ธฐ์ค€, Dev Container๋Š” Ubuntu Snap ํŒจํ‚ค์ง€(snapcraft)๋กœ ์„ค์น˜๋œ Docker์—๋Š” ์ง€์›๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ์ž($USER)๋ฅผ docker ๊ทธ๋ฃน์— ์ถ”๊ฐ€ํ•˜์—ฌ์•ผํ•ฉ๋‹ˆ๋‹ค.
    (์œ„ ๊ฒŒ์‹œ๋ฌผ์˜ 3. ๊ถŒํ•œ ์ƒ์Šน ์„ค์ • (์„ ํƒ) ์ฐธ๊ณ )

1. Dev Containers ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ

Visual Studio Code(์ดํ•˜, VSCode)์—์„œ ์ œ๊ณต๋˜๋Š”, Dev Containers ํ™•์žฅ ํ”„๋กœ๊ทธ๋žจ์„ ์‚ฌ์šฉํ•˜๋ฉด, ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์— ํ•„์š”ํ•œ ๋ชจ๋“  ๊ธฐ๋Šฅ์ด ๊ฐ–์ถฐ์ง„ Container๋ฅผ ๊ตฌ์ถ•ํ•˜์—ฌ ํ™˜๊ฒฝ์„ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Ubuntu Docker ์„ค์น˜

  • kkumtree

2025-10-17T20:53:27+09:00

Docker ์‚ฌ์šฉ์„ ์œ„ํ•œ ๊ธฐ๋ณธ์ ์ธ ์„ค์น˜ ๋ฐฉ๋ฒ• ๋ฉ”๋ชจ

0. ์ด์ „ ๋ฒ„์ „ ์ œ๊ฑฐ (์„ ํƒ)

  • ์ง„ํ–‰ ์ค‘์ธ Docker ๊ด€๋ จ ์ž‘์—…์ด ์—†์–ด, prune ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ๊ธฐ์กด Docker์˜ ๋ฆฌ์†Œ์Šค๋“ค์„ ์‚ญ์ œ ์ง„ํ–‰ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
docker system prune -a

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

alt text

Jenkins ์ปจํ…Œ์ด๋„ˆ์—์„œ Host์˜ Docker ๋ฐ๋ชฌ ์‚ฌ์šฉํ•˜๊ธฐ

  • kkumtree

2024-09-01T09:02:15+09:00

์ตœ๊ทผ CloudNet@์—์„œ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋Š” K8s Advanced Network Study(์ดํ•˜, KANS)์— ์ฐธ์—ฌํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
๋‚œ์ด๋„๋ฅผ ์ƒ๊ฐํ•˜๋ฉด KH(Hardcore)NS๊ฐ€ ๋” ๋งž์•„๋ณด์ด์ง€๋งŒ…

k8s๊ฐ€ ์›Œ๋‚™ ์ธ๊ธฐ๊ฐ€ ๋งŽ๊ธฐ๋„ ํ•˜์ง€๋งŒ, Pod ๊ฐ„ ํ†ต์‹ ์—๋Š” ๋งŽ์€ ์ง€์‹์ด ํˆฌ์—ฌ๋˜๊ธฐ์— ์ด๋ฒˆ ๊ธฐํšŒ์— ์‚ดํŽด๋ณด๊ธฐ๋กœ ํ–ˆ์Šต๋‹ˆ๋‹ค.

๋”ํ™ฉ์ฑ 

์ฒซ ์ฃผ์ฐจ๋Š”, ๋ฐ”๋กœ Kubernetes์— ์ง„์ž…ํ•˜์ง€ ์•Š๊ณ  Containerization์— ๋Œ€ํ•œ ์ดํ•ด๋ฅผ ๋จผ์ € ๋‹ค๋ค„์ฃผ์…จ์Šต๋‹ˆ๋‹ค.
์—ฌํƒ€ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ๊ฐ•์˜์™€ ๋‹ฌ๋ฆฌ 9์ฃผ ๊ฐ„ ๋งค์ฃผ ์ผ์š”์ผ์—๋งŒ ์ง„ํ–‰๋˜๋Š” ์„ธ์…˜์ธ๋ฐ๋„, ๊ธฐ๋ฐ˜ ๊ธฐ์ˆ ์„ ๋‹ค์‹œ ์งš์–ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค.

1. AWS EC2 Instance ์…‹์—…

CloudFormation์„ ํ†ตํ•ด, EC2 ๋ฐ ์ œ๋ฐ˜์‚ฌํ•ญ์„ ๊ตฌ์„ฑํ•˜์—ฌ ์ฃผ์…จ์Šต๋‹ˆ๋‹ค๋งŒ, ์ทจ๋ฏธ ์‚ผ์•„ Terraform ๋ณ€ํ™˜ ์ž‘์—…์„ ํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค. ํ•˜์ง€ ๋ง์•˜์–ด์•ผํ–ˆ๋Š”๋ฐ… LoL

kkumtree

Source code on GitHub

ยฉ 2025 kkumtree and contributors All rights reserved.
Licensed under
CC BY-NC-ND 4.0