[Docker๐Ÿณ] Docker ๊น”๊ธฐ (Linux)

Jeong SeongYunยท2022๋…„ 9์›” 23์ผ
0

Docker

๋ชฉ๋ก ๋ณด๊ธฐ
3/10
post-thumbnail

Docker๋ฅผ ๋‹ค๋ฃจ๋Š” ํ™˜๊ฒฝ์ธ Linux์— ๋Œ€ํ•ด ์ด์ œ ์–ด๋Š ์ •๋„ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ณต์žกํ•œ ๋ช…๋ น์–ด๊ฐ€ ๋งŽ์ง€๋งŒ ๋ญ ์ต์ˆ™ํ•ด์ง€๊ฒ ์ฃ ?

์ด์ œ ๋“œ๋””์–ด! Docker๋ฅผ ๊น”์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!

์ž…๋ ฅํ•ด์•ผ ํ•˜๋Š” ๋ช…๋ น์–ด

  1. sudo apt update : ์ผ๋‹จ ํŒจํ‚ค์ง€ ์—…๋ฐ์ดํŠธ

  2. sudo apt install apt-transport-https ca-certificates curl software-properties-common : https ๊ด€๋ จ ํŒจํ‚ค์ง€ ์„ค์น˜ (Docker๋ฅผ ๋ฐ›๊ธฐ ์œ„ํ•œ ์„œ๋ฒ„์— ์ ‘์†ํ•˜๋ ค๋ฉด https๊ฐ€ ๊ฐ€๋Šฅํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์„ค์น˜ํ•ด์ค๋‹ˆ๋‹ค.)

  3. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - : ์•”ํ˜ธํ™”๋ฅผ ์œ„ํ•œ ํ‚ค๋ฅผ ๋ฐ›๋Š” ๋ช…๋ น์–ด

  4. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" : docker์šฉ ์„œ๋ฒ„๋ฅผ ๋ฐ›์•„์˜ด

  5. sudo apt update : ๋ฐ›์•„์˜จ ์„œ๋ฒ„๋ฅผ ํฌํ•จํ•ด์„œ ๋‹ค์‹œ ํŒจํ‚ค์ง€๋ฅผ ์—…๋ฐ์ดํŠธ

  6. sudo apt install docker-ce : docker ์„ค์น˜!!!!!

  7. sudo systemctl status docker : ์ž˜ ์„ค์น˜๋๋‚˜ ํ™•์ธ.. ์•„๋ž˜์™€ ๊ฐ™์ด activate๊ฐ€ ๋œจ๋ฉด ์„ฑ๊ณต!

  8. :q๋กœ ๋‚˜์˜ค๊ธฐ

docker ๊ทธ๋ฃน์— ์‚ฌ์šฉ์ž ๋“ฑ๋กํ•˜๊ธฐ

docker ๋ช…๋ น์–ด์—” ํ•ญ์ƒ sudo๋กœ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์„ ํ•„์š”๋กœ ํ•˜๊ธฐ ๋•Œ๋ฌธ์ด์ฃ .

๋งจ๋‚  ์ž…๋ ฅํ•˜๊ธฐ ๊ท€์ฐฎ์œผ๋‹ˆ, ํ˜„์žฌ ์‚ฌ์šฉ์ž๋ฅผ docker ๊ทธ๋ฃน์— ๋“ฑ๋ก์‹œํ‚ด์œผ๋กœ์จ ํ˜„์žฌ ์‚ฌ์šฉ์ž๋Š” ์•ˆ์‹ฌํ•ด๋„ ๋˜๋Š” ๋Œ€์ƒ์ด๋ผ๋Š” ๊ฒƒ์„ ์•Œ๋ ค์ค์‹œ๋‹ค.

  1. sudo usermod -aG docker ${USER} : ๋“ฑ๋ก
  2. ์žฌ์ ‘์†
  3. id -nG : ์‚ฌ์šฉ์ž๊ฐ€ group์— ๋“ฑ๋ก ๋˜์—ˆ๋Š” ์ง€ ํ™•์ธ
    ๋งˆ์ง€๋ง‰์— docker๊ฐ€ ์žˆ๋Š” ๊ฒŒ ๋ณด์ด์ฃ ?

docker-compose ์„ค์น˜

  1. sudo curl -L "https://github.com/docker/compose/releases/download/๋ฒ„์ „/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose : docker-compose๋ฅผ ์„ค์น˜ํ•ด์ค๋‹ˆ๋‹ค. (๋ฒ„์ „์€ ์•Œ์•„์„œ ์ตœ์‹  ๊ฒƒ์œผ๋กœ ์„ค์น˜)
  2. sudo chmod +x /usr/local/bin/docker-compose : ํ•ด๋‹น ํŒŒ์ผ์˜ "์‹คํ–‰" ๊ถŒํ•œ ๋ถ€์—ฌ

์ด์ œ ์ง„์งœ Docker ์‹œ์ž‘์ž…๋‹ˆ๋‹ค. ํ•œ๋ฒˆ ๊ฐ€๋ณด์ฃ !

profile
๋ฌผ์–ด๋ณด๋ฉด ๋Œ€๋‹ตํ•ด์ค„ ์ˆ˜ ์žˆ๋Š” ๋ฐ์ดํ„ฐ์Ÿ์ด

0๊ฐœ์˜ ๋Œ“๊ธ€