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.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 (~30MB compressed) with a single dynamically linked binary.
(from within the wire-server
directory)
make docker-builder
make docker-deps
make docker-intermediate # recompiles all the haskell code
make docker-exe-brig # this only extracts one binary from the intermediate image above and makes it the default entrypoint. Nothing gets recompiled
Dockerfile.migrations
- same asDockerfile.executable
, with a fixed set of database migration binaries.Dockerfile.prebuilder
- dependencies ofDockerfile.builder
that are expected to change very rarely (GHC, system libraries). Currently we're able to use system GHC, but if we require a newer version of GHC than the one provided by Alpine, we could build GHC inDockerfile.prebuilder
(as it has been done before).