From 27bddf3a6e407e0da5b9eedaa23c48c59b6872e0 Mon Sep 17 00:00:00 2001 From: Richard Zowalla Date: Sun, 31 Mar 2024 11:56:32 +0200 Subject: [PATCH] TOMEE-4314 - Fix docker-compose.yml to build TomEE inside a docker container. Adds profiles to distinguish between different build flavours --- README.adoc | 10 ++++++++++ docker-compose.yml | 12 ++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 08d68511787..a36fd97dc09 100644 --- a/README.adoc +++ b/README.adoc @@ -103,6 +103,16 @@ execute: mvn clean install -pl maven/tomee-embedded-maven-plugin -am -Dmaven.test.skip=true .... +=== Build with Docker + +There is also a `docker-compose.yml` available to build TomEE with several profiles. For a quick build without tests, you can run + +``` +docker compose --profile build-quick up +``` + +on the project root. There are additional profiles available, e.g. for attaching with a debugger or running a full build. + === Contributing The http://tomee.apache.org/community/index.html[community] section from diff --git a/docker-compose.yml b/docker-compose.yml index 6399f3bbda6..f018e114415 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,8 @@ services: - m2:/var/maven/.m2 # Build+test. Stops on first test failure build: - image: "maven:3.3.9-jdk-8" + image: "maven:3-eclipse-temurin-11" + profiles: ["build"] command: ["-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "clean", "install"] entrypoint: "mvn" working_dir: /opt/project @@ -42,7 +43,8 @@ services: - volume_perms # Build+test. Does not stop on test failures build-all: - image: "maven:3.3.9-jdk-8" + image: "maven:3-eclipse-temurin-11" + profiles: ["build-all"] command: ["--fail-at-end", "-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "clean", "install"] entrypoint: "mvn" working_dir: /opt/project @@ -59,7 +61,8 @@ services: - volume_perms # Just build (no tests) build-quick: - image: "maven:3.3.9-jdk-8" + image: "maven:3-eclipse-temurin-11" + profiles: ["build-quick"] command: ["-Duser.home=/var/maven", "-Pquick", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "-DuniqueVersion=false", "-ff", "-Dassemble", "-DskipTests", "-DfailIfNoTests=false", "clean", "install"] entrypoint: "mvn" working_dir: /opt/project @@ -74,7 +77,8 @@ services: - volume_perms # Build+test. Waits for debugger on port 5005. Stops on first test failure debug: - image: "maven:3.3.9-jdk-8" + image: "maven:3-eclipse-temurin-11" + profiles: ["build-debug"] command: ["-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "-Dopenejb.server.debug", "-Dmaven.surefire.debug", "-Dopenejb.arquillian.debug=true", "clean", "install"] entrypoint: "mvn" working_dir: /opt/project