Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent of GitHub deploy keys for Docker Hub private repositories?

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?

like image 748
Martin Törnwall Avatar asked Apr 06 '16 20:04

Martin Törnwall


1 Answers

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.

like image 121
Ray Avatar answered Oct 06 '22 02:10

Ray