Docker and Registry V2


Dockerfiles for backend services are located in src/backend and for frontend services in src/frontend/web_application. Additionally, two other Dockerfiles are used for backend services, useful to reduce compilation time and for multi-stage builds:

Docker Registry

Public / Private registry

The Docker registry is exposed both publicly through, to allow everybody to pull images, and privately (requiring authentication), so only members can push images.

Makefile and manual publishing

Although not especially useful considering Drone usually keeps both stable and unstable images up to date in the registry, there is a generic Makefile to build and publish Caliopen images and a script to build and publish every service with a given tag. Note that to publish images with the script you need to have the registry credentials defined in a registry.conf file in the same directory. Usage:

./publish-images <tag>

Currently the docker-compose file is used to build the images. Ideally, this should be changed to docker build commands.

Getting a list of images and tags available

A simpler and prettier way to do it is with a tool such as registry-cli.

Cleaning image layers to reduce disk usage

The aforementioned tool also allows the deletion of images. Note that this does not actually delete the images, it only marks them for deletion, so the garbage collector can later delete them. For our registry the garbage collector runs once a week through a cronjob but it can also be manually ran. The environment variable REGISTRY_STORAGE_DELETE_ENABLED has to be set to "true" for the deletion to work, inside the docker-compose file of the registry for example.

Integration with Drone

As previously mentioned, Drone automatically build and publishes stable and unstable versions of the images to the registry.