$ canary validate --file check-port.yaml nginx
Validating nginx against check-port
Check port 80 [passed]
validation passed
Reproducer
$ docker run -p 80:80 nginx # Start a process that binds to port 80 in another terminal
$ canary validate --file /tmp/test.yaml nginx
Validating nginx against check-port
\ Starting container
Error: container failed to start after 10 seconds
~The container also doesn't get cleaned up.~
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e8d32b8f45aa nginx "/docker-entrypoint.…" 2 minutes ago Created canary-runner-d43137e8
If canary tries to expose a container port for testing and that port is already in use the container fails to start and canary fails to validate.
Works
Reproducer
~The container also doesn't get cleaned up.~