java-build  1.0.0
Containerized environment for building Java based projects.
java-build and Related Docker Images

Containerized Java build environment.

See for and source files.

Documentation for the creation and use of together with related image build and container creation scripts.


File Description
base.dockerfile Dockerfile for base image containing standard build tool chain (Java 8, Maven, Doxygen etc.)
user.dockerfile Dockerfile for creating images customized for an individual user
gitlabci.dockerfile Dockerfile for creating images for with GitLab CI
build-base-image Convenience script for building java-build image from base.dockerfile
build-user-image Convenience script for building a particular user's image from user.dockerfile
build-gitlabci-image Convenience script for building an image from gitlabci.dockerfile
run-java-build-container Convenience script for running containers from images created using build-user-image

The preceding scripts and Docker configuration files can be used to produce containers like:

where each container contains a common build environment with user- or server-specific credentials and similar configuration.

The base.dockerfile defines the following base build environment:

  • Centos 7
    • g++
    • libtool
    • autoconf
    • automake
    • cmake
  • Git (with LFS)
  • OpenJDK 8
  • Maven
  • Doxygen
  • Graphviz
  • PlantUML
  • texlive
  • Docker CLI*
    • docker
    • docker-compose

* Containers created from the images defined by this project's Docker image configuration files are expected to be invoked using -v /var/run/docker.sock:/var/run/docker.sock. I.e. they should use the host's docker daemon rather than one running in the container. See run-java-build-container for more information.

The user.dockerfile adds to the image created by base.dockerfile by:

  • Logging into Centos as a specific user
  • Including that user's SSH keys in ~/.ssh
  • Including that user's Maven settings.xml in ~/.m2
  • Configuring Git with full name and email address (git config --global ...)
  • Defining mount points, /projects and /mvn_repo, where build scripts can find source files, create and install build artifacts etc. in the host file system

Overall Work Flow


Configuring texlive

Consider implications of the following output from texlive's install-tl script:

TEXDIR (the main TeX directory):
TEXMFLOCAL (directory for site-wide local files):
TEXMFSYSVAR (directory for variable and automatically generated data):
TEXMFSYSCONFIG (directory for local config):
TEXMFVAR (personal directory for variable and automatically generated data):
TEXMFCONFIG (personal directory for local config):
TEXMFHOME (directory for user-specific files):