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

Authentication failures for Amazon ECR with parallel builds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins version 1.59 with docker-build-publish plugin version 1.3.2 and amazon-ecr-plugin 1.4

      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.

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

              Created:
              Updated: