Skip to content
Advertisement

Maven Hangs Downloading Inside a Docker Container

I have a gitlab with gitlab ci and a runner all running fine in a CoreOs Machine.

All 3 services are running using the following dockerfiles service files and build script:

Build Script:

JavaScript

CI service:

JavaScript

CI-runner service:

JavaScript

Ci runner dockerfile:

JavaScript

Ci dockerfile is unmodified version of sameersbn/gitlab-ci:5.2.0.

when i compile a maven project (with mvn install) it starts to download the required artifacts and the download hangs, if i retry the download over and over again it manages to fully download problem is i need to download all at once without interruptions (it manages to continue cause im storing all the downloads on a mapped volume)

Observations:

-I deployed the Ci runner container on my local machine instead of the server and linked to the gitlab ci and the problem persists.

-If you go inside the container (with docker-enter script or docker exec container bash) and run mvn install on a terminal it downloads everything as it should, although downloading it within the build it hangs.

-i tried using Setting MAVEN_OPTS to -Djava.net.preferIPv4Stack=true on dockerfile of CI-Runner,i also tried to include it in the build script of CI-Runner to force this variable:

  • In the dockerfile i added ENV MAVEN_OPTS -Djava.net.preferIPv4Stack=true
  • In the build script i added MAVEN_OPTS=-Djava.net.preferIPv4Stack=true

-Running in debug mode (-e) or reading the logs the only information i have is :Download Timeout

Advertisement

Answer

UPDATE: Maven doesnt actually hangs, the build is completed successfully.But the runner doesnt communicate to the gitlab ci saying it made its work sucessfully due to a response error: 500.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement