Docker Network - vvonha/NaverAPI GitHub Wiki

Docker Network? [๊ฐ€์ƒ๋„คํŠธ์›Œํฌ์˜ ์ข…๋ฅ˜] image

  • Host-Only: ์™ธ๋ถ€์™€ ๋‹จ์ ˆ๋œ ๋‚ด๋ถ€ ๋„คํŠธ์›Œํฌ ๊ตฌ์ถ•ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๊ตฌ์„ฑ๋œ ๊ฐ€์ƒ๋จธ์‹ ๋“ค๋ผ๋ฆฌ๋งŒ ํ†ต์‹ ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.
  • NAT(Network Address Translation): ํ˜ธ์ŠคํŠธ PC๋กœ๋ถ€ํ„ฐ IP๋ฅผ ํ• ๋‹น ๋ฐ›์•„ ๊ฐ€์ƒ๋จธ์‹  ํ”„๋กœ๊ทธ๋žจ์ด ์ž์ฒด DHCP์„œ๋ฒ„๋ฅผ ๋„์›Œ ๋‚ด๋ถ€ ๋„คํŠธ์›Œํฌ ๋Œ€์—ญ ํ• ๋‹น ๋ฐ ํ†ต์‹ ์„ ํ•œ๋‹ค. ํ˜ธ์ŠคํŠธ PC๋ฅผ ํ†ตํ•ด ์™ธ๋ถ€ ๋„คํŠธ์›Œํฌ์™€ ํ†ต์‹ ์ด ๊ฐ€๋Šซํ•˜๋‹ค.
  • Bridge: ๊ณต์œ ๊ธฐ๋กœ๋ถ€ํ„ฐ IP๋ฅผ ํ• ๋‹น ๋ฐ›์•„, ํ˜ธ์ŠคํŠธPC์™€ ๋™์ผํ•œ ๋„คํŠธ์›Œํฌ ๋Œ€์—ญ์˜ IP๋ฅผ ๊ฐ–๊ฒŒ ๋œ๋‹ค. ๊ณต์œ ๊ธฐ๋ฅผ ํ†ตํ•ด ์™ธ๋ถ€ ๋„คํŠธ์›Œํฌ์™€ ํ†ต์‹ ์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

-> ๋„คํŠธ์›Œํฌ์—์„œ ๋ธŒ๋ฆฟ์ง€๋ž€ ๊ฐ„๋‹จํžˆ ๋งํ•ด์„œ ์ปดํ“จํ„ฐ ๋‚ด๋ถ€์— ์žˆ๋Š” ๊ฐ€์ƒ ์Šค์œ„์น˜ ํ—ˆ๋ธŒ๋ผ๊ณ  ๋ณด๋ฉด ๋œ๋‹ค.

[Docker network drivers]

  • Docker networking subsystem์€ Network driver ๋“ค์„ ์ด์šฉํ•ด Container ๊ฐ„ ์—ฐ๊ฒฐ์„ ์‰ฝ๊ฒŒํ•  ์ˆ˜ ์žˆ๋‹ค. ์—ฌ๋Ÿฌ Network driver๋“ค์€ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณต๋˜๋ฉฐ Network driver๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ฒƒ๋“ค์ด ์žˆ๋‹ค.
  • Bridge
  • Host
  • Overlay
  • Macvlan -None
  • Network plugins

[Docker network driver bridge]

  • ๋„์ปค์—์„œ์˜ ๋ธŒ๋ฆฟ์ง€๋Š” ์ฃผ๋กœ ์†Œํ”„ํŠธ์›จ์–ด ๋ธŒ๋ฆฟ์ง€๋ฅผ ์˜๋ฏธํ•œ๋‹ค.
  • ์ด ๋ธŒ๋ฆฟ์ง€๋Š” ๊ฐ™์€ ๋ธŒ๋ฆฟ์ง€์— ์—ฐ๊ฒฐ๋œ ์ปจํ…Œ์ด๋„ˆ๋“ค๋ผ๋ฆฌ์˜ ํ†ต์‹ ์„ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด ์ฃผ๊ณ , ๋ธŒ๋ฆฟ์ง€์— ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์€ ์ปจํ…Œ์ด๋„ˆ๋กœ๋ถ€ํ„ฐ๋Š” ๊ณ ๋ฆฝ์‹œ์ผœ์ฃผ๋Š” ์—ญํ• ์„ ํ•œ๋‹ค.

[์ฐธ๊ณ ] https://developerin.tistory.com/18 [์ฐธ๊ณ ] https://jangseongwoo.github.io/docker/docker_container_network/ [์ฐธ๊ณ ] https://mns010.tistory.com/20