I want to package my Maven/Java app in a Docker Gitlab CI runner.
I'm behind a corporation proxy. This is my .gitlab-ci.yml
:
image: maven:3-jdk-7
build:
script: "mvn clean package -B"
When a build is triggered, I get this error (in the Gitlab build console):
Unknown host repo.maven.apache.org: Name or service not known -> [Help 1]
Then, I have added
variables:
http_proxy: http://user:pass@corp.proxy.ip:port
to the .gitlab-ci.yml
. But I get another error:
fatal: unable to access 'http://gitlab-ci-token:xxxxxx@170.20.20.20:8080/myapp.git/': The requested URL returned error: 504
When I registered the Docker runner, Docker image selected was maven:3-jdk-7
.
I have just tried adding no_proxy
variable with 172.20.20.20 as value (Gitlab IP) but I get the same error (the first one.)
How can I solve it? Is there a way to force the Docker runner (container) to use --net=host
?