title: Passing creds to gitlab-ci runner to be able to push docker image…?
body: <p>I'm setting up a gitlab-ci process, but I'm having trouble understanding how I should manage my secrets…</p>
  
  <p>So I have successfully started up a gitlab/gitlab-runner as a docker container and registered a docker runner from gitlab/dind.</p>
  
  <p>The thing I want to build in this case is simply building a docker image from a Dockerfile, populating caches to later be used by other ci integration test builds. This by pushing it up to my private docker registry. My .gitlab-ci.yml definition in this case is just:</p>
  
  <pre><code>build_image:
    script:
      - docker build -t ensime/ensime-atom-ci .
      - docker tag ensime/ensime-atom-ci docker.woodenstake.se/ensime/ensime-atom-ci
      - docker push docker.woodenstake.se/ensime/ensime-atom-ci
  </code></pre>
  
  <p>Seems simple enough, but of course I have no creds here so it fails:</p>
  
  <p>I just came from drone where I generated a .sec file for this.</p>
  
  <p>But here I should login, right? So I've read here</p>
  
  <p><a href="https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/configuration/advanced-configuration.md#using-a-private-docker-registry" rel="nofollow">https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/configuration/advanced-configuration.md#using-a-private-docker-registry</a></p>
  
  <p>Problem is since I'm running gitlab-runner from within the dockerized gitlab/gitlab-runner image, there doesn't even seem to be a docker cli there?</p>
  
  <pre><code>viktor@i7:/var/lib$ sudo docker exec -it gitlab-runner docker login
  exec: "docker": executable file not found in $PATH
  </code></pre>
  
  <p>Any tips highly appreciated!</p>
  
  <p>Update for clarification:</p>
  
  <p>So the tail of the gitlab-ci build log is:</p>
  
  <pre><code>012ca7ed9b62: Retrying in 1 seconds
  173cd98367a6: Retrying in 1 seconds
  92b0661193a5: Retrying in 1 seconds
  c12ecfd4861d: Waiting
  5f70bf18a086: Retrying in 5 seconds
  no basic auth credentials
  
  ERROR: Build failed: exit code 1
  </code></pre>
  
  <p>The host machine is logged in the registry as root. Trying to login from the docker container I just don't even have docker cli. </p>
  
  <p>I have added the <code>--docker-privileged</code> flag on the registration of the runner.</p>
  
  <p>I guess the credentials needs to pass through host -> gitlab-runner -> runner instance (dind)</p>