firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.33k stars 132 forks source link

Add `--extra-host` arguments to services #1086

Closed PigeonF closed 8 months ago

PigeonF commented 8 months ago

When running a docker:dind service I realized that the --extra-host arguments passed to gitlab-ci-local get passed to the running image, but not to the services, which broke the resolution for my finagled $CI_REGISTRY_IMAGE in the docker in docker container (since the registry was resolved in the service container when using docker buildx build --push).

Since the services already get the same volumes as the main container, I think it makes sense to pass the extra-host args as well. What do you think? I don't know how controversial this change is, so if you think this is a bad idea, feel free to close the PR 😅 .

P.S. Is the test fine like this? I mostly cobbled it together by combining the existing add-host <test-job> test with the services <multie-job> test.