I'm building my stack of docker container from various docker-compose examples around the net and I constantly run into troubles trying to "convert" between docker-compose file versions.
For this discussion I'm trying to "convert" the QNAP Container station Qnet network driver example [1]:
version: '2'
services:
qnet_dhcp:
image: alpine
command: ifconfig eth0
networks:
- qnet-dhcp
qnet_static:
image: alpine
command: ifconfig eth0
networks:
qnet-static:
ipv4_address: 192.168.80.119
networks:
qnet-dhcp:
driver: qnet
ipam:
driver: qnet
options:
iface: "eth0"
qnet-static:
driver: qnet
ipam:
driver: qnet
options:
iface: "eth0"
config:
- subnet: 192.168.80.0/23
gateway: 192.168.80.254
I've come as far as this (the qnet-static section I can't get to work):
version: "3"
services:
qnet_dhcp:
image: alpine
command: ifconfig eth0
networks:
- qnet-dhcp
networks:
qnet-dhcp:
driver: qnet
driver_opts:
iface: "eth0"
This "compiles" but I get errors when I run it (on a QNAP TVS-1282T):
[/share/data/appdata] # docker-compose up -d
Creating network "appdata_qnet-dhcp" with driver "qnet"
Creating appdata_qnet_dhcp_1 ... error
ERROR: for appdata_qnet_dhcp_1 Cannot start service qnet_dhcp: failed to create endpoint appdata_qnet_dhcp_1 owork appdata_qnet-dhcp: NetworkDriver.CreateEndpoint: invalid literal for int() with base 16: ''
ERROR: for qnet_dhcp Cannot start service qnet_dhcp: failed to create endpoint appdata_qnet_dhcp_1 on network ta_qnet-dhcp: NetworkDriver.CreateEndpoint: invalid literal for int() with base 16: ''
ERROR: Encountered errors while bringing up the project.
Can someone clarify the changes between docker-compose file version 2 and version 3 that are relevant to this example?
[1] https://qnap-dev.github.io/container-station-api/qnet.html#docker-compose