I'm trying to use a Docker Hub private repository to deploy an image to a couple of production servers. I'd like to accomplish this without storing my personal Docker Hub credentials on the servers (and preferably avoid setting up a dedicated deploy user).
Is there anything conceptually similar to GitHub's deploy keys?
As far as I can tell Docker communicates with remote repositories at Docker Hub using the REST API. This document overviews how repos work and how Docker Hub itself is setup: https://docs.docker.com/v1.7/docker/reference/api/hub_registry_spec/ I do not know if v1.7 is the latest version of the spec.
Looking at the Docker hub REST api documentation, right now the only option for requests requireing authentication is to validate with Basic auth over SSL or with a Token. This means using your dockerhub credentials at one point or another--your credentials are to obtain a token.
I don't know how long a Token last for. If it's indefinite you could us it like an API key, requesting one and putting that in your code. Somehow I suspect it's temporary, however, like Oauth tokens are meant to be.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With