To create docker images, you need to install docker version >= 17.05 and make
.
Dockerfile.builder
contains all the compile-time dependencies necessary to compile any of the haskell services (it also downloads, builds and caches some haskell libraries). This image is fairly large, ~4GB uncompressed.Dockerfile.deps
contains all the run-time dependencies e.g. shared libraries, at a total size of ~18MB compressed.
Both of the above need to be built first (only once) to be able to actually build a service docker image.
Dockerfile
depends on the two images above to compile code inside thebuilder
image and then copy the resulting binary into thedeps
image to finally construct a service (e.g.brig
) docker image that can be used for testing or deployment. The final image is ~30MB (compressed) in size.
cd build/alpine && make
cd services/brig && make docker
Dockerfile.intermediate
- based onDockerfile.deps
/Dockerfile.builder
, this is an intermediate image compiling all dynamically linked binaries (obtained when runningmake install
in the top-level directory).Dockerfile.executable
- based onDockerfile.deps
/Dockerfile.intermediate
, this extracts a single executable from the intermediate image, yielding a small image with a single dynamically linked binary.Dockerfile.migrations
- same as Dockerfile.executable, with a fixed set of database migration binaries.