Error pulling docker image - error response from daemon

Hello everyone,
I am trying to do some super simple CI to gain an understanding of how it all works. However I am struggling with running the CI tests.

When the individual job fails and I see the following message:

Running with gitlab-runner 15.7.0~beta.37.g94f38c73 (94f38c73)  on gitlab-runner-l-01 M5szZqgnPreparing the "docker" executorUsing Docker executor with image python:3.8-slim-buster ...Pulling docker image python:3.8-slim-buster ...WARNING: Failed to pull image with policy "always": Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) (manager.go:237:15s)ERROR: Job failed: failed to pull image "python:3.8-slim-buster" with specified policies [always]: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) (manager.go:237:15s)

The .gitlab-ci.yml is very simple and a modified version of one of the templates. It can be seen below.

image: python:3.8-slim-buster
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip
    - venv/

before_script:
  - pip install virtualenv 
  - pip3 install -r requirements.txt
  - virtualenv venv
  - source venv/bin/activate

test:
  script:
    - pytest

I have tried various different python images including python:latest and a version of 3.6 which is the one I would ideally like to use but I still get the same error message.

If anyone has any ideas I would be very grateful to hear them!

1 Like

are you able to docker pull python:3.8-slim-buster image on the host where GitLab runner runs?

1 Like

I am using some shared runners within my organisation’s group. Would it be better to try and set up some specific runners?

1 Like

depends on your use case… if you expect the runners to be able to pull the images from dockerhub, then it might be runners’ issue which needs to be solved.

If you don’t, then you may need to set up self-hosted gitlab runners. I describe the use case of docker pipelines in the linked blog article.

2 Likes

That is great thank you. I will have a read.

1 Like