-
Bug
-
Resolution: Unresolved
-
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.