Closed octane100 closed 1 month ago
I can reproduce your issue, and you are right about the PR that introduced the issue.
Reading through https://docs.docker.com/network/, the same error happens for
$ gitlab-ci-local --network=host
$ gitlab-ci-local --network=none
Additionally, the following syntax works to connect to a container directly using docker CLI
$ docker run -d --name redis redis --bind 127.0.0.1
$ docker run --rm -it --network container:redis redis redis-cli -h 127.0.0.1 PING
but when used with docker connect
, it seems the same syntax does not work
$ docker run -d --name redis redis --bind 127.0.0.1
$ gitlab-ci-local --network container:redis
parsing and downloads finished in 48 ms
job starting alpine:latest (test)
job copied to docker volumes in 1.23 s
job > time="2024-05-17T12:03:03+02:00" level=error msg="error waiting for container: context canceled"
job > Error response from daemon: network container:redis not found
job finished in 1.68 s FAIL 1
FAIL job
> time="2024-05-17T12:03:03+02:00" level=error msg="error waiting for container: context canceled"
> Error response from daemon: network container:redis not found
I am not sure about the last one, but the first two can probably be special-cased in the code and handled that way.
Minimal .gitlab-ci.yml illustrating the issue
With gitlab-ci-local 4.49.0, the following error is reported when running with parameter
--network host
:Expected behavior Being able to run with host networking
Host information Ubuntu 22.04 gitlab-ci-local 4.49.0
Containerd binary docker.io 24.0.5-0ubuntu1~22.04.1
Additional context The same command is working as expected with gitlab-ci-local 4.48.2. Regression may have been introduced by #1205