This will be short post on how to build and run docker registry from sources.
I need a registry to deploy my docker images to use them with docker swarm. So the docker swarm nodes will pull images of my applications from registry. So there will be single point where all the machines in cluster can download custom application.
First problem is that docker registry is not available on arm architecture for raspberry pi. Fortunately it is opensource project so I can download it, build and run docker image. Before that I need to setup golang development environment by simply installing go compiler and set up GOPATH
then I will set up GOPATH by editing .profile in my home directory (or .bashrc if there is no .profile file):
and add lines:
after reload profile (
source ~/.profile) or login again to shell I can check if everything is set properly by using:
and it should output something like:
now to build registry I will just invoke:
and after a while I can use registry command so binary is build and located in
Running registry as docker image
then replace registry in cloned repo with my registry
I built my image as
Run registry from source
And there it is running. Important notes are :
- I need to point registry location in all my docker machine nodes in daemon.json files. Just add those two lines.
so the final daemon.json will look something like this:
- If I consider to run registry in public network I need to consider adding trusted tls certificate like let’s encrypt.
Ok so now I have docker swarm on three nodes and docker registry ready for some scaling fun. Next will be building custom docker image putting it in registry and scaling it. Adding / removing nodes and using docker-compose. Also after a month or so looking on those configuration madness I think it is a good idea to make a simple python webapp to automate shit.