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
I’m trying to use gitlab-ci-local on macOS to test GitLab CI pipelines locally, which is a perfect tool for this use case.
My setup:
The pipeline starts a docker:24.x.x image.
Inside the job, it executes docker build . command to build a Java application using maven:3.9.x-eclipse-temurin-21.
The Java build requires both:
Internal Maven repository.
Public Maven repositories (repo.maven.apache.org, etc.).
The problem:
When running the pipeline locally via gitlab-ci-local on macOS:
The job container itself can resolve internal and external hostnames (ping/nslookup works).
However, the docker build step inside the job container fails to resolve:
2a. Internal Maven repo
2b. Public Maven repos
I have tried:
• --add-host internal.maven.repo:IP → internal host resolves, but public Maven repositories fail.
• Attempting to override /etc/resolv.conf → fails because it’s read-only inside build containers.
• --network=host → fails on macOS BuildKit (network.host is not allowed).
It seems that docker-in-docker on macOS cannot inherit the network/DNS configuration from the job container, which makes it impossible for the build container to access both internal or external dependencies.
I’m looking for guidance on:
• How to make docker builds inside gitlab-ci-local pipelines on macOS resolve both internal and external DNS correctly.
• Any known workarounds or best practices for this situation.
Pipeline template looks something like this (its the first ste:
Dockerfile is standard build for Java App using mvn install which uses docker.io/maven:3.9.6-eclipse-temurin-21 for building.
When running mvn install i get error about resolving internal DNS with error Temporary failure in name resolution. After trying to fix this with --add-host internal.maven.repo:IP flag as i mentioned earlier, i get error about not being able to resolve public maven repository, so i cannot test the later stages of pipeline - deploy and test.
And just for clarification - all works when running via GitlabCI runner...
If there is anything else I can add, please let me know, i will try to provide the best information I can give.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I’m trying to use gitlab-ci-local on macOS to test GitLab CI pipelines locally, which is a perfect tool for this use case.
My setup:
docker build .command to build a Java application using maven:3.9.x-eclipse-temurin-21.The problem:
When running the pipeline locally via gitlab-ci-local on macOS:
2a. Internal Maven repo
2b. Public Maven repos
I have tried:
• --add-host internal.maven.repo:IP → internal host resolves, but public Maven repositories fail.
• Attempting to override /etc/resolv.conf → fails because it’s read-only inside build containers.
• --network=host → fails on macOS BuildKit (network.host is not allowed).
It seems that docker-in-docker on macOS cannot inherit the network/DNS configuration from the job container, which makes it impossible for the build container to access both internal or external dependencies.
I’m looking for guidance on:
• How to make docker builds inside gitlab-ci-local pipelines on macOS resolve both internal and external DNS correctly.
• Any known workarounds or best practices for this situation.
Pipeline template looks something like this (its the first ste:
Dockerfile is standard build for Java App using
mvn installwhich usesdocker.io/maven:3.9.6-eclipse-temurin-21for building.When running
mvn installi get error about resolving internal DNS with errorTemporary failure in name resolution. After trying to fix this with--add-host internal.maven.repo:IPflag as i mentioned earlier, i get error about not being able to resolve public maven repository, so i cannot test the later stages of pipeline - deploy and test.And just for clarification - all works when running via GitlabCI runner...
If there is anything else I can add, please let me know, i will try to provide the best information I can give.
Thanks in advance for any help or suggestions!
Beta Was this translation helpful? Give feedback.
All reactions