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

Containerized Java build environment.

See https://gitlab.com/kirkrader/java-build for README.md and source files.

Documentation for the creation and use of registry.gitlab.com/kirkrader/java-build:latest together with related image build and container creation scripts.

Overview

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

TO DO

Configuring texlive

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

TEXDIR (the main TeX directory):
  /usr/local/texlive/2018
TEXMFLOCAL (directory for site-wide local files):
  /usr/local/texlive/texmf-local
TEXMFSYSVAR (directory for variable and automatically generated data):
  /usr/local/texlive/2018/texmf-var
TEXMFSYSCONFIG (directory for local config):
  /usr/local/texlive/2018/texmf-config
TEXMFVAR (personal directory for variable and automatically generated data):
  ~/.texlive2018/texmf-var
TEXMFCONFIG (personal directory for local config):
  ~/.texlive2018/texmf-config
TEXMFHOME (directory for user-specific files):
  ~/texmf