title: Cannot pull images using authenticated user in GitlabCI
body: <p>I'm trying to mitigate the DockerHub pull limit by logging in to a DockerHub account in my <code>gitlab-runner</code>. I'm not using methods like Gitlab's Dependency proxy because I would have to edit hundreds of files. I decided to log in to Docker in <code>gitlab-runner</code>.</p>
  <p><code>.gitlab-ci.yml</code>:</p>
  <pre><code>image: docker
  
  services:
    - docker:dind
  
  stages:
    - base
  
  docker-build:
    stage: base
    tags:
      - experimental
    script:
      - docker build -t grex:alpine_${CI_PIPELINE_ID} ./alpine
      - docker info
  </code></pre>
  <p>The <code>alpine</code> folder contains a Dockerfile containing just <code>FROM alpine</code>.
  The <code>config.toml</code> of the <code>gitlab-runner</code> has the line <code>pre_build_script = &quot;docker login -u grex -p &lt;password&gt;&quot;</code></p>
  <p>The <code>docker info</code> line states that my user is logged in.
  I followed all of the options from <a href="https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#authenticate-with-registry-in-docker-in-docker" rel="nofollow noreferrer">the docs</a> but to no avail. After each pipeline run, I checked the current rate limit for my user and it remained unchanged, leaving me to infer the pipeline made an unauthenticated docker pull. Any help is appreciated!</p>