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

Authentication failures for Amazon ECR with parallel builds

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins version 1.59 with docker-build-publish plugin version 1.3.2 and amazon-ecr-plugin 1.4
    • Similar Issues:

      Description

      If parallel builds of Docker images are triggered on a slave, the ECR authentication fails because the Docker configuration file is empty:

      [Docker-build-image-foo] $ docker build --build-arg DOCKER_GIT_COMMIT=[...] 123456789-foo.amazonaws.com/path:latest --pull=true quux
      WARNING: Error loading config file:/var/lib/jenkins/.docker/config.json - EOF
      Sending build context to Docker daemon 4.608 kB
      Step 1/5 : FROM 123456789-foo.amazonaws.com/path:base
      Pulling repository 123456789-foo.amazonaws.com/path
      unauthorized: authentication required
      Build step 'Docker Build and Publish' marked build as failure

      Our hypothesis is that parallel instances perform an ECR login, leading to an empty Docker config.  In other Jenkins jobs, where we manually log in, we use file locking in $HOME/.docker/config.json to prevent this issue with success.

        Attachments

          Activity

          Hide
          tsuna Benoit Sigoure added a comment -

          Your hypothesis is right, we ran into this today. I proposed a fix upstream: https://github.com/docker/cli/pull/1359

          Show
          tsuna Benoit Sigoure added a comment - Your hypothesis is right, we ran into this today. I proposed a fix upstream: https://github.com/docker/cli/pull/1359

            People

            Assignee:
            csanchez Carlos Sanchez
            Reporter:
            pvtilburg Paul van Tilburg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: