```๋์ปค ์์ฑ ๋ฒ์
docker-compose ๋ฒ์ 1.11.2, ๋น๋ dfed245
docker-py ๋ฒ์ : 2.1.0
CPython ๋ฒ์ : 2.7.5
OpenSSL ๋ฒ์ : OpenSSL 1.0.1e-fips 2013 ๋
2 ์ 11 ์ผ
```uname -srvmpio
Linux 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux```
version: '2.1'
services:
xxx:
image: xxx:latest
networks:
- ExtNet:
ipv4_address: 192.168.1.11
- IntNet
networks:
ExtNet:
driver: macvlan
driver_opts:
parent: enp3s0
ipam:
config:
- gateway: 192.168.1.1
ip_range: 192.168.1.10/28
subnet: 192.168.1.0/24
IntNet:
internal: True
driver: bridge
ipam:
config:
- ip_range: 10.0.0.0/16
subnet: 10.0.0.0/16
services.xxx.networks contains {"ExtNet": {"ipv4_address": "192.168.1.11"}}, which is an invalid type, it should be a string
# Tried docker compose yaml version 2.0, 2.1 and 3.0.
services:
xxx:
image: xxx:latest
networks:
- ExtNet:
ipv4_address: 192.168.1.11
"services.xxx.networks"์ ํญ๋ชฉ ์ค ํ๋๊ฐ ๋ฌธ์์ด (์ด ๊ฒฝ์ฐ "IntNet")์ด๋ฉด ๋ชจ๋ ํญ๋ชฉ์ด ๋ฌธ์์ด ์ธ ๊ฒ์ผ๋ก ์์๋ฉ๋๋ค.
ํํ์ ์์ํ๋๋ก "services.xxx.networks"๋ฅผ ๋ณ๊ฒฝํ ์ ์์ต๋๊น?
์ฌ์ค ๋ ๋ฒ์งธ ๊ตฌ์ฑ๋ ์๋ชป๋์์ต๋๋ค. networks
๋ ๋ฌธ์์ด ๋ชฉ๋ก ๋๋ ๋งคํ (ํ์ด์ฌ dict
๋ํ YAML ์ด๋ฆ)์
๋๋ค. https://docs.docker.com/compose/compose-file/compose-file-v2/#networks
์๋ฅผ ๋ค์ด ๋ค์์ ์ํ๋ ๊ตฌ์ฑ์ ์ ํจํ ํ์์ ๋๋ค.
services:
xxx:
image: xxx:latest
networks:
ExtNet:
ipv4_address: 192.168.1.11
IntNet: {}
์ ์๋ํฉ๋๋ค. ์ ๋ง ๊ณ ๋ง์ต๋๋ค :)
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ฌ์ค ๋ ๋ฒ์งธ ๊ตฌ์ฑ๋ ์๋ชป๋์์ต๋๋ค.
networks
๋ ๋ฌธ์์ด ๋ชฉ๋ก ๋๋ ๋งคํ (ํ์ด์ฌdict
๋ํ YAML ์ด๋ฆ)์ ๋๋ค. https://docs.docker.com/compose/compose-file/compose-file-v2/#networks์๋ฅผ ๋ค์ด ๋ค์์ ์ํ๋ ๊ตฌ์ฑ์ ์ ํจํ ํ์์ ๋๋ค.