Problem

We would like to provide a simple way to deploy and run Apache Bookkeeper with an official Docker image.

We decided to not make a request to official docker images library in order to maintain implementation freedom and to not require a third party approval for every change to our dockerfiles. The choice is to create builds for Apache docker user, so we will have images named "apache/bookkeper:4.4.0" instead of "bookkeeper:4.4.0".

Docker Image

Is based on Alpine Linux, a very appreciated distro for docker image (for lightweightness and security orientation)

Problem: Alpine uses a lightweight libc implementation that could lead to some compatibility issues with some system specific java libraries. The only problem I encountered so far is with Linux native epoll in Netty 4 (an issue for BK 4.5.0).

Follows nearly all docker official image guidelines

Problem: it currenty lacks only the key import in gpg signature verification. The best practice is:

In current docker build "gpg --keyserver" and "gpg --batch" are commented.Providing a way to verify downloaded release is not mandatory, but it's a nice to have.

Directory Structure and Repository

We will include bookkeeper build files in the main repository, in a directory named "bookkeeper-docker".

We will provide a docker build file for each released version (starting from 4.4.0). Each build will be contained in a subdirectory named like the label we want to assign to it (i.e "4.4.0/" for image "apache/bookkeer:4.4.0").

The docker build file and all related files contained in these subdirectories will be used by dockerhub to create automated builds for every version.

Question: could be useful provide a docker build "onbuild" for the last snapshot of the current development version?

Main directory will contain the Readme to be shown in dockerhub image page

Currently main directory contains a Makefile that shows how to use bookkeeper image in order to build up a fully functional ensemble of 1 zookkeper, 3 bookies and 2 bookkeeper tutorial (a simple dice rolling application) containers. This makefile has been very useful to me in order to test builds and could be useful to who is approaching bookkeeper providing a functional example to play with, but it could be easily removed, if desired.

I struggled with metadata format too, and I resolved providing a very naif way to use the image for initializing it (like you could see in makefile https://github.com/caiok/bookkeeper-docker/blob/master/Makefile, target "run-format") but it's not very suited for automatic deploy. Your solution is very interesting and I will surely take a closer look and integrate to the current image.

I updated the image in https://github.com/caiok/bookkeeper-docker. Now it handles configuration of zkLedgersRootPath via environment variable and seems to resolve the metadata problem in a trivial way (I've tried and it works in my enviroment).