You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: (HTTP code 400) unexpected - invalid JSON: json: cannot unmarshal object into Go struct field IPAM.IPAM.Config of type []network.IPAMConfig
This is due to incorrect parameters being generated for docker.createNetwork() in the lib/network.js file
For example :
line 49:
var opts = {
Name: projectName + '_' + networkName,
Driver: network.driver,
DriverOpts: network.driver_opts, //unsetted in docker-compose.yml
Labels: {
...network.labels,
...{
'com.docker.compose.network': 'default',
'com.docker.compose.project': projectName,
},
},
Attachable: network.attachable, //may be unsetted in docker-compose.yml
EnableIPv6: network.enable_ipv6, //may be unsetted in docker-compose.yml
Internal: network.internal, //may be unsetted in docker-compose.yml
CheckDuplicate: true,
};
line 69
opts.IPAM = {
Driver: network.ipam.driver, //may be unsetted in docker-compose.yml
Options: network.ipam.options, //may be unsetted in docker-compose.yml
};
line 74
opts.IPAM['Config'] = {
Subnet: network.ipam.config.subnet, // network.ipam.config - its an array! .subnet may be unsetted
IPRange: network.ipam.config.ip_range, // network.ipam.config - its an array! .ip_range may be unsetted
Gateway: network.ipam.config.gateway, // network.ipam.config - its an array! .gateway may be unsetted
AuxAddress: network.ipam.config.aux_addresses, // network.ipam.config - its an array! .aux_addresses may be unsetted
};
dockerode-compose will not work if
docker-compose.yml
file have small sectionnetworks
:This configuration generates an error:
This is due to incorrect parameters being generated for
docker.createNetwork()
in thelib/network.js
fileFor example :
line 49:
line 69
line 74
For the correct parameters for creating a network with Dockerode, see the Docerode tests:
The text was updated successfully, but these errors were encountered: