Pipeline job stalling in simple Dockerfile build

Hi all,

One of the jobs I have in a Pipeline is hanging in a simple Dockerfile build, as below. This is causing the job to time out. It started happening for the past ~2 weeks, while it has been working fine before and also in my local box. I have colleagues with similar symptoms. We are using registry.gitlab.com/citygro/docker-and-compose as an image and setting service tag to docker:dind in the gitlab ci file.

RUN echo "--------------- Installing API flask app ---------------"
COPY . $SOURCE

The last few lines from the job log as in gitlab UI are below for reference:

 Setting up gfortran (4:6.3.0-4) ...
 update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode
 update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode
 Setting up python-keyring (10.1-1) ...
 Processing triggers for libc-bin (2.24-11+deb9u4) ...
 Removing intermediate container de392de0df01
  ---> c4fdfd991196
 Step 4/16 : RUN echo "--------------- Installing API flask app ---------------"
  ---> Running in d5f4db842c60
 --------------- Installing API flask app ---------------
Pulling docker image gitlab/gitlab-runner-helper:x86_64-12a489c4 ...
00:00
 ERROR: Job failed: execution took longer than 30m0s seconds

This build normally takes < 10 min and I’ve reduced the default 1h timeout to 30 minutes to avoid over-consumption of build minutes quota.

Has anyone experienced this? Any insights?
Thanks!

Yes, we are also facing the same issue for two of our docker projects on gitlab.
For us the “pulling docker image” fails at this Dockerfile step:
Step 5/13 : RUN mkdir /code

I have been facing this issue for a week now. I still have no clue why it might be happening…

Yes, this is also the case for us, it started failing at a similar line ‘RUN mkdir /app’ just today on the shared runner, the Dockerfile is working fine locally.

This is blocking a lot of our work, any idea what’s the problem and how to solve it?

I am experiencing a similar issue. It started two days ago. We have not updated our gitlab-ci.yml file or any of our dockerfiles for the project yet the build is consistently failing across all branches.

This fixed it for me:

Update from another thread

It’s a docker issue. GitLab tries to get the latest stable version automatically, but it seems like it’s not so stable. Adding the following to .gitlab-ci.yml in the build stage should get you back up and running:

services:
    - docker:19.03.5-dind

If you use AutoDevOps configs, it seems like there’s nothing to do but wait.

Gitlab CI Docker Stalls After 2 Min. - stackoverflow Q&A

Thanks @bynarystudio! That has done the trick.

1 Like