The config file was being truncated first, which created a window during which it was empty, causing concurrent uses of the `docker` command to potentially fail with: WARNING: Error loading config file: /var/lib/jenkins/.docker/config.json: EOF Error response from daemon: Get https://registry/v2/foo/manifests/latest: no basic auth credentials Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>