Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38986

Cannot run a docker push registry:image when slaves running on a swarm

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • docker-plugin
    • None

      Context :

      • Slaves are provisioned by a docker swarm
      • /var/run/docker.sock mounted in slaves containers
      • Slaves base image contains a readable docker.json with auth correctly configured

      A shell step with docker push <registry>:<image> fails with permission denied.

      This is due to the DOCKER_HOST variable that is set during exec, the docker engine doesn't use the local docker.sock & local docker.json config.

      Removing this variable with unset DOCKER_HOST before the docker push solves the issue.

      I don't know if some people might need that variable but the behavior must be configurable somehow.

            ndeloof Nicolas De Loof
            pgmillon Pierre-Gildas MILLON
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: