Looks like this is because it defaults to use the secretservice
executable which seems to have some sort of X11 dependency for some reason. If you install and configure pass
docker will use that instead which seems to solve the problem.
In a nutshell (from https://github.com/docker/compose/issues/6023)
sudo apt install gnupg2 pass
gpg2 --full-generate-key
This generates a you a gpg2 key. After that’s done you can list it with
gpg2 -k
Copy the key id (from the line labelled [uid]
) and do
pass init "whatever key id you have"
Now docker login
should work.
There are a couple of bugs logged on launchpad regarding this:
https://bugs.launchpad.net/ubuntu/+source/docker-compose/+bug/1796119