In a nutshell: use git repositories as docker repositories (if you don’t mind the build being done locally).
Background: After realizing on our last project that setting up + running a private Docker registry is non-trivial, my buddy had what I think is a great idea: why not just use
docker build? So recently I sat down and wrote
docker-get, which allows you to do just that:
$ docker-get github.com/codemy/dockerfile/redis $ docker run -it github.com/codemy/dockerfile/redis
You can also pull a specific tag / branch / commit, which will produce a corresponding docker tag:
$ docker-get github.com/codemy/dockerfile/redis:master $ docker run -it github.com/codemy/dockerfile/redis:master
$ docker-get github.com/codemy/dockerfile/redis:07dd89aba13aa46af2b53d72f91567cc1a9fe941 $ docker run -it github.com/codemy/dockerfile/redis:07dd89aba13aa46af2b53d72f91567cc1a9fe941
The repos are checked out to and cached in a
$DOCKERPATH, analogously to
Since it’s just a shell script calling
docker, the whole thing works for any repo your
git can reach.