compose: docker-compose-up fails to fetch remote images
Description of the issue
If an image used by docker-compose.yml
is not cached locally, running docker-compose up
will fail with the errors shown below (appears to be related to credentials).
Context information (for bug reports)
Output of docker-compose version
docker-compose version 1.24.1, build 4667896b
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
Output of docker version
Client: Docker Engine - Community
Version: 19.03.2
API version: 1.40
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:26:49 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.2
API version: 1.40 (minimum version 1.12)
Go version: go1.12.8
Git commit: 6a30dfc
Built: Thu Aug 29 05:32:21 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.6
GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc:
Version: 1.0.0-rc8
GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f
docker-init:
Version: 0.18.0
GitCommit: fec3683
Output of docker-compose config
services:
anything:
image: nginx
version: '2.0'
(nginx is used as an example here but any docker hub image will do)
Steps to reproduce the issue
- Ensure you do not have the configured image locally
- Run
docker-compose up
Observed result
An error (see below)
Expected result
Image is downloaded
Stacktrace / full error message
Pulling anything (nginx:)...
Traceback (most recent call last):
File "site-packages/dockerpycreds/store.py", line 80, in _execute
File "subprocess.py", line 356, in check_output
File "subprocess.py", line 438, in run
subprocess.CalledProcessError: Command '['/usr/local/bin/docker-credential-desktop', 'get']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore
File "site-packages/dockerpycreds/store.py", line 35, in get
File "site-packages/dockerpycreds/store.py", line 93, in _execute
dockerpycreds.errors.StoreError: Credentials store docker-credential-desktop exited with "No stored credential for https://index.docker.io/v1/".
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose/cli/main.py", line 71, in main
File "compose/cli/main.py", line 127, in perform_command
File "compose/cli/main.py", line 1085, in up
File "compose/cli/main.py", line 1081, in up
File "compose/project.py", line 527, in up
File "compose/service.py", line 354, in ensure_image_exists
File "compose/service.py", line 1222, in pull
File "compose/progress_stream.py", line 102, in get_digest_from_pull
File "compose/service.py", line 1187, in _do_pull
File "site-packages/docker/api/image.py", line 381, in pull
File "site-packages/docker/auth.py", line 48, in get_config_header
File "site-packages/docker/auth.py", line 322, in resolve_authconfig
File "site-packages/docker/auth.py", line 235, in resolve_authconfig
File "site-packages/docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "No stored credential for https://index.docker.io/v1/".',)
[3629] Failed to execute script docker-compose
Additional information
I have never signed in to the docker daemon (I do not have an account).
Pulling the image first (i.e. docker pull nginx
) makes the command succeed.
OS version: macOS 10.14.6
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 15
In case anybody else runs into this problem, and discovers this stale issue. A workaround for the problem is here: https://github.com/docker/for-mac/issues/3805#issuecomment-518619953
@davidje13 Yes, I am the same as you think, whey does it be required on macOS, but not on Linux.
BTW, If these images are not from the docker hub (index.docker.io), but from other places, such as docker.package.github.com. This problem still occurs, even if you logged in. All you need to do is check the option in Docker Desktop, as shown in red in the following picture.