ํ’€์Šคํƒ ์›น๐ŸŒ ๊ฐœ๋ฐœ์ž ์ง€๋ง์ƒ ๐Ÿง‘๐Ÿฝโ€๐Ÿ’ป
โž• ์ธ๊ณต์ง€๋Šฅ ๊ด€์‹ฌ ๐Ÿค–


Categories


Recent views


DinD์™€ DooD

DinD์™€ DooD

[DinD(docker in docker)์™€ DooD(docker out of docker) ์•„์ด๋‹จ์€ ์–ด๋””๊ฐ”์„๊นŒ](https://aidanbae.github.io/code/docker/dinddood/)

๋„์ปค ์ปจํ…Œ์ด๋„ˆ ์•ˆ์—์„œ ๋„์ปค ์‹คํ–‰ํ•˜๊ธฐ(Docker in Docker, Docker Out of Docker) : ๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ์•ˆ์—์„œ ๋„์ปค ์‹คํ–‰ํ•˜๊ธฐ(Docker in Docker, Docker Out of Docker) : ๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ ๋ณด์•ˆ ํ™•์ธ : ์™ธ๋ถ€๋งํฌ
"https://m.blog.naver.com/PostV..."๋กœ ?

์ฐธ์กฐ

DinD(Docker in Docker) ๊ตฌ์กฐ

๋„์ปค๊ฐ€ ์„ค์น˜๋œ ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ๋‚ด๋ถ€์— ๋„์ปค ๋ฐ๋ชฌ์„ ์ถ”๊ฐ€๋กœ ๋Œ๋ฆฌ๋Š”, ์ฆ‰ ์ปจํ…Œ์ด๋„ˆ ์•ˆ์— ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ค‘์ฒฉ๋˜์–ด ์žˆ๋Š” ๊ตฌ์กฐ

๐ŸŸข ๋ณ„๋„์˜ ๊ฐ€์ƒํ™˜๊ฒฝ์„ ๊ฒฉ๋ฆฌํ•˜๊ณ , ํ•˜์œ„์˜ ์—ฌ๋Ÿฌ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ํ•œ๊บผ๋ฒˆ์— ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค.

๐Ÿ”ด ๊ฒ‰๊ป์งˆ ์ปจํ…Œ์ด๋„ˆ๋Š” --privileged ํ”Œ๋ž˜๊ทธ๋ฅผ ํ†ตํ•ด ํ˜ธ์ŠคํŠธ ๊ถŒํ•œ์„ ํš๋“ํ•˜๋Š”๋ฐ, ์ด ๋•Œ๋ฌธ์— ๋ณด์•ˆ์ƒ ์ข‹์ง€ ์•Š์„ ์ˆ˜ ์žˆ๋‹ค.

๋”ฐ๋ผ์„œ Docker์—์„œ๋Š” DinD๋ณด๋‹ค DooD ๊ตฌ์กฐ๋ฅผ ์ถ”์ฒœํ•œ๋‹ค.

DooD(Docker out of Docker) ๊ตฌ์กฐ

์ฃผ ์ปจํ…Œ์ด๋„ˆ ๋‚ด๋ถ€์— ์†ํ•˜๋Š” ๋ฐฉ์‹์ด ์•„๋‹ˆ๋ผ, ๋ณ‘๋ ฌ์ ์œผ๋กœ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋‘˜ ์ƒ์„ฑํ•œ ๋’ค, socket์„ ๊ณต์œ ํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค.

์•„๋ž˜์™€ ๊ฐ™์ด ์†Œ์ผ“์„ ๊ณต์œ ํ•œ ์ปจํ…Œ์ด๋„ˆ๋งŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค.

docker run -v /var/run/docker.sock:/var/run/docker.sock ...

๐ŸŸข DinD์™€ ๋‹ฌ๋ฆฌ ์œ ์ €๊ทธ๋ฃน์„ ๊ณต์œ ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ, ํ•˜๋‚˜์˜ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ๋ชจ๋“  ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์ œ์–ดํ•˜๋Š” ๋ณด์•ˆ ์œ„ํ—˜์ด ์—†๋‹ค.

๐Ÿ”ด ๋ฌผ๋ก , volume์˜ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๊ณต์œ  ์‹œ, ์ปจํ…Œ์ด๋„ˆ ๊ฐ„์˜ ์ž์›์ด ๊ณต์œ  ๊ฐ€๋Šฅํ•˜๋ฏ€๋กœ ์œ„ํ—˜ํ•œ๊ฒƒ์€ ์—ฌ์ „ํ•˜๋‹ค.