I've been trying to deploy containers with fleet
on a CoreOS cluster. However, some of the docker images are privately stored on quay.io
requiring a login.
Now I could add a docker login
as a precondition to every relevant unit file, but that doesn't seem right. I'm sure there must be a way to store the respective registry credentials somewhere docker can find it when trying to download the image.
Any ideas?
The best way to do this is with a Quay "robot account", which is a separate set of credentials than your regular account. This is helpful for two reasons:
When you make a new robot account, if you click "view credentials", you will get the credentials pre-formatted for common use-cases, such as Docker and Kubernetes.
In this case, you want "Docker Configuration", which is placed at ~/.docker/config.json
on the server(s). Docker will automatically use this to authenticate with Quay.io.