libcompose
libcompose copied to clipboard
While scaling, libcompose do not prints error message for Port Clash.
expected behaviour
$ docker-compose scale web=2
WARNING: The "web" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
Starting sample_web_1 ... error
Starting sample_web_2 ... done
ERROR: for sample_web_1 failed to create endpoint sample_web_1 on network bridge: Bind for 0.0.0.0:5000 failed: port is already allocated
Actual Behaviour
$ libcompose scale web=2
WARN[0000] Note: This is an experimental alternate implementation of the Compose CLI (https://github.com/docker/compose)
INFO[0000] Setting scale web=2...
WARN[0000] The "web" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
WARN[0000] The mapping "." is ambiguous. In a future version of Docker, it will designate a "named" volume (see https://github.com/docker/docker/pull/14242). To prevent unexpected behaviour, change it to "./.".
@kunalkushwaha with current master the output I get :
$ libcompose-cli -p toto -f integration/assets/regression/152-scale-port.yml scale simple=2
WARN[0000] Note: This is an experimental alternate implementation of the Compose CLI (https://github.com/docker/compose)
INFO[0000] Setting scale simple=2...
WARN[0000] The "simple" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
FATA[0000] Failed to set the scale simple=2: Error response from daemon: driver failed programming external connectivity on endpoint toto_simple_2 (e8ea7c6b39554d173f03150b0611f19472a3a1eaa0d519c1d9dbb9c4d06a6ad9): Bind for 0.0.0.0:3000 failed: port is already allocated
The message is not exactly the same, but it's not that far either.
Let's make the message a little closer to docker-compose :angel: