Build a legacy software with docker

Cindy Piassale21/01/2020


Following the rework of a legacy application in GWT for a client, we encountered problems during compilation. Indeed it required the installation of old libraries not available on the current environments of the developers.

The idea was therefore to provide a functional compilation solution on any environment :

  • developer workstation

  • client workstation

  • development / integration server

For that purpose we have decided to use docker. We created a docker image from a maven image, on which we downloaded the GWT libraries necessary for the compilation of the project.

Which gives the following Dockerfile :

Dockerfile.build
FROM maven:3.6-jdk-7

WORKDIR /var
RUN curl https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/google-web-toolkit/gwt-linux-1.5.3.tar.bz2 | tar xjf -

Then we created a script to start the compilation :

build-with-docker.sh
docker build -t mvn-gwt -f Dockerfile.build .
docker run \
  -v ~/.m2:/var/maven/.m2 \
  -v "$PWD":/usr/local/src/ \
  -w /usr/local/src/  \
  -ti --rm -u $(id -u) \
  -e MAVEN_CONFIG=/var/maven/.m2 \
  mvn-gwt \
  mvn -Duser.home=/var/maven -Dgoogle.webtoolkit.home=/var/gwt-linux-1.5.3 $1

From this script the compilation of the project can be started from any environment by simply running the command :

./build-with-docker.sh <target_maven>


A propos de JECI

Maintenance Logicielle, Conteneur (Docker, Kubernetes), Alfresco Community, Logiciels Libres
SARL - Capital : 100 000 €, immatriculée au RCS de Dijon

Nous contacter

+33 9 72 38 21 92 info@jeci.fr

2013-2020 Jeci | Mixed with v4.3.2 | Baked with JBake v2.6.4 | Photo by Troy Mortier on Unsplash | Mentions légales