Official Docker image with Maven
Find a file
Carlos Sanchez d6d849139e
Some checks failed
amazoncorretto-17-windowsservercore / build (push) Has been cancelled
amazoncorretto-17 / build (push) Has been cancelled
amazoncorretto-21-al2023 / build (push) Has been cancelled
amazoncorretto-21-debian / build (push) Has been cancelled
amazoncorretto-8-al2023 / build (push) Has been cancelled
amazoncorretto-21 / build (push) Has been cancelled
amazoncorretto-8-debian / build (push) Has been cancelled
amazoncorretto-11-al2023 / build (push) Has been cancelled
amazoncorretto-11-debian / build (push) Has been cancelled
amazoncorretto-11-windowsservercore / build (push) Has been cancelled
amazoncorretto-11 / build (push) Has been cancelled
amazoncorretto-17-al2023 / build (push) Has been cancelled
amazoncorretto-17-debian / build (push) Has been cancelled
amazoncorretto-8-windowsservercore / build (push) Has been cancelled
amazoncorretto-8 / build (push) Has been cancelled
azulzulu-11-alpine / build (push) Has been cancelled
azulzulu-11-debian / build (push) Has been cancelled
azulzulu-11-windowsservercore / build (push) Has been cancelled
azulzulu-11 / build (push) Has been cancelled
azulzulu-17-alpine / build (push) Has been cancelled
azulzulu-17-debian / build (push) Has been cancelled
azulzulu-21-alpine / build (push) Has been cancelled
azulzulu-21-debian / build (push) Has been cancelled
azulzulu-21 / build (push) Has been cancelled
azulzulu-8 / build (push) Has been cancelled
eclipse-temurin-11-alpine / build (push) Has been cancelled
eclipse-temurin-11-focal / build (push) Has been cancelled
azulzulu-17-windowsservercore / build (push) Has been cancelled
azulzulu-17 / build (push) Has been cancelled
azulzulu-8-alpine / build (push) Has been cancelled
azulzulu-8-debian / build (push) Has been cancelled
eclipse-temurin-11 / build (push) Has been cancelled
eclipse-temurin-17-alpine / build (push) Has been cancelled
eclipse-temurin-17-focal / build (push) Has been cancelled
eclipse-temurin-17 / build (push) Has been cancelled
eclipse-temurin-21 / build (push) Has been cancelled
eclipse-temurin-22-alpine / build (push) Has been cancelled
eclipse-temurin-22-jammy / build (push) Has been cancelled
eclipse-temurin-22 / build (push) Has been cancelled
eclipse-temurin-8-alpine / build (push) Has been cancelled
eclipse-temurin-8-focal / build (push) Has been cancelled
eclipse-temurin-8 / build (push) Has been cancelled
graalvm-community-17 / build (push) Has been cancelled
ibm-semeru-11-focal / build (push) Has been cancelled
eclipse-temurin-21-alpine / build (push) Has been cancelled
eclipse-temurin-21-jammy / build (push) Has been cancelled
graalvm-community-21 / build (push) Has been cancelled
ibm-semeru-17-focal / build (push) Has been cancelled
ibm-semeru-21-jammy / build (push) Has been cancelled
ibmjava-8 / build (push) Has been cancelled
libericaopenjdk-11-alpine / build (push) Has been cancelled
libericaopenjdk-11-debian / build (push) Has been cancelled
libericaopenjdk-17-alpine / build (push) Has been cancelled
libericaopenjdk-17-debian / build (push) Has been cancelled
libericaopenjdk-8-alpine / build (push) Has been cancelled
libericaopenjdk-8-debian / build (push) Has been cancelled
microsoft-openjdk-11-ubuntu / build (push) Has been cancelled
microsoft-openjdk-17-ubuntu / build (push) Has been cancelled
microsoft-openjdk-21-ubuntu / build (push) Has been cancelled
openjdk-11-windowsservercore / build (push) Has been cancelled
openjdk-8-windowsservercore / build (push) Has been cancelled
openjdk-11-nanoserver / build (push) Has been cancelled
openjdk-8-nanoserver / build (push) Has been cancelled
oracle-graalvm-17 / build (push) Has been cancelled
oracle-graalvm-21 / build (push) Has been cancelled
sapmachine-11 / build (push) Has been cancelled
sapmachine-17 / build (push) Has been cancelled
sapmachine-21 / build (push) Has been cancelled
sapmachine-22 / build (push) Has been cancelled
chore: prepare docs and tests for maven 4
2024-08-21 14:18:24 +02:00
.github chore(deps): bump docker/setup-buildx-action from 3.5.0 to 3.6.1 2024-08-12 15:46:39 +02:00
amazoncorretto-8 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-8-al2023 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-8-debian chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-8-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
amazoncorretto-11 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-11-al2023 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-11-debian chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-11-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
amazoncorretto-17 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-17-al2023 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-17-debian chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-17-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
amazoncorretto-21 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-21-al2023 chore: switch base image 2024-08-20 20:12:59 +02:00
amazoncorretto-21-debian chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-8 chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-8-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-8-debian chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-11 chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-11-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-11-debian chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-11-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
azulzulu-17 chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-17-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-17-debian chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-17-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
azulzulu-21 chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-21-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
azulzulu-21-debian chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-8 chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-8-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-8-focal chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-11 chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-11-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-11-focal chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-17 chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-17-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-17-focal chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-21 chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-21-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-21-jammy chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-22 chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-22-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
eclipse-temurin-22-jammy chore: switch base image 2024-08-20 20:12:59 +02:00
graalvm-community-17 chore: switch base image 2024-08-20 20:12:59 +02:00
graalvm-community-21 chore: switch base image 2024-08-20 20:12:59 +02:00
ibm-semeru-11-focal chore: switch base image 2024-08-20 20:12:59 +02:00
ibm-semeru-17-focal chore: switch base image 2024-08-20 20:12:59 +02:00
ibm-semeru-21-jammy chore: switch base image 2024-08-20 20:12:59 +02:00
ibmjava-8 chore: switch base image 2024-08-20 20:12:59 +02:00
libericaopenjdk-8-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
libericaopenjdk-8-debian chore: switch base image 2024-08-20 20:12:59 +02:00
libericaopenjdk-11-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
libericaopenjdk-11-debian chore: switch base image 2024-08-20 20:12:59 +02:00
libericaopenjdk-17-alpine chore: switch base image 2024-08-20 20:12:59 +02:00
libericaopenjdk-17-debian chore: switch base image 2024-08-20 20:12:59 +02:00
microsoft-openjdk-11-ubuntu chore: switch base image 2024-08-20 20:12:59 +02:00
microsoft-openjdk-17-ubuntu chore: switch base image 2024-08-20 20:12:59 +02:00
microsoft-openjdk-21-ubuntu chore: switch base image 2024-08-20 20:12:59 +02:00
openjdk-8-nanoserver feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
openjdk-8-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
openjdk-11-nanoserver feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
openjdk-11-windowsservercore feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
oracle-graalvm-17 chore: switch base image 2024-08-20 20:12:59 +02:00
oracle-graalvm-21 chore: switch base image 2024-08-20 20:12:59 +02:00
sapmachine-11 chore: switch base image 2024-08-20 20:12:59 +02:00
sapmachine-17 chore: switch base image 2024-08-20 20:12:59 +02:00
sapmachine-21 chore: switch base image 2024-08-20 20:12:59 +02:00
sapmachine-22 chore: switch base image 2024-08-20 20:12:59 +02:00
tests chore: prepare docs and tests for maven 4 2024-08-21 14:18:24 +02:00
.gitignore Add Liberica 17 CentOS and Alpine 2022-05-26 20:38:21 +02:00
.gitmodules test: switch bats action to bats-core/bats-action 2023-12-26 20:14:25 +01:00
common.sh chore: prepare docs and tests for maven 4 2024-08-21 14:18:24 +02:00
Dockerfile-template chore: switch base image 2024-08-20 20:12:59 +02:00
generate-stackbrew-library.sh feat: Add GraalVM images (#446) 2024-02-08 19:29:19 +01:00
github-action-generation.sh build: remove the 'other' workflow 2023-02-14 14:29:47 +01:00
github-action.ps1 feat: maven 3.9.9 2024-08-19 10:57:28 +02:00
LICENSE Initial commit 2014-10-08 17:26:56 +02:00
logo.png Official version submitted to docker-library 2014-10-15 13:17:35 +02:00
publish.sh chore: prepare docs and tests for maven 4 2024-08-21 14:18:24 +02:00
README-short.txt Official version submitted to docker-library 2014-10-15 13:17:35 +02:00
README.md chore: prepare docs and tests for maven 4 2024-08-21 14:18:24 +02:00
tags-for-dir.sh chore: switch branch master to main 2023-04-10 19:01:47 +02:00

docker-maven

Supported tags and respective Dockerfile links

Images are published under:

Linux Based Images

See Docker Hub or GitHub Container Registry for an updated list of tags

Only under csanchez/maven and ghcr.io/carlossg/maven:

Windows Based Images

See Docker Hub csanchez/maven for an updated list of tags

What is Maven?

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

How to use this image

You can run a Maven project by using the Maven Docker image directly, passing a Maven command to docker run:

Linux

docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-17 mvn verify

Windows

docker run -it --rm --name my-maven-project -v "$(Get-Location)":C:/Src -w C:/Src csanchez/maven:3.3-jdk-17-windows mvn verify

Windows

docker run -it --rm --name my-maven-project -v "$(Get-Location)":C:/Src -w C:/Src maven:3.3-jdk-17-windows mvn clean install

Building local Docker image (optional)

This is a base image that you can extend, so it has the bare minimum packages needed. If you add custom package(s) to the Dockerfile, then you can build your local Docker image like this:

docker build --tag my_local_maven:3.9.9-jdk-8 .

Multi-stage Builds

You can build your application with Maven and package it in an image that does not include Maven using multi-stage builds.

# build
FROM maven
WORKDIR /usr/src/app
COPY pom.xml .
RUN mvn -B -e -C -T 1C org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
COPY . .
RUN mvn -B -e -o -T 1C verify

# package without maven
FROM eclipse-temurin:17-jdk
COPY --from=0 /usr/src/app/target/*.jar ./

Reusing the Maven local repository

The local Maven repository can be reused across containers by creating a volume and mounting it in /root/.m2.

docker volume create --name maven-repo
docker run -it -v maven-repo:/root/.m2 maven mvn archetype:generate # will download artifacts
docker run -it -v maven-repo:/root/.m2 maven mvn archetype:generate # will reuse downloaded artifacts

Or you can just use your home .m2 cache directory that you share e.g. with your Eclipse/IDEA:

docker run -it --rm -v "$PWD":/usr/src/mymaven -v "$HOME/.m2":/root/.m2 -v "$PWD/target:/usr/src/mymaven/target" -w /usr/src/mymaven maven mvn package

Packaging a local repository with the image

The $MAVEN_CONFIG dir (default to /root/.m2 or C:\Users\ContainerUser\.m2) could be configured as a volume so anything copied there in a Dockerfile at build time is lost. For that reason the dir /usr/share/maven/ref/ (or C:\ProgramData\Maven\Reference) exists, and anything in that directory will be copied on container startup to $MAVEN_CONFIG.

To create a pre-packaged repository, create a pom.xml with the dependencies you need and use this in your Dockerfile. /usr/share/maven/ref/settings-docker.xml (C:\ProgramData\Maven\Reference\settings-docker.xml) is a settings file that changes the local repository to /usr/share/maven/ref/repository (C:\Programdata\Maven\Reference\repository), but you can use your own settings file as long as it uses /usr/share/maven/ref/repository (C:\ProgramData\Maven\Reference\repository) as local repo.

COPY pom.xml /tmp/pom.xml
RUN mvn -B -f /tmp/pom.xml -s /usr/share/maven/ref/settings-docker.xml dependency:resolve

To add your custom settings.xml file to the image use

COPY settings.xml /usr/share/maven/ref/

For an example, check the tests dir

Running as non-root (not supported on Windows)

Maven needs the user home to download artifacts to, and if the user does not exist in the image an extra user.home Java property needs to be set.

For example, to run as the current user (instead of root), mounting the host Maven repo (at ~/.m2)

docker run -v ~/.m2:/var/maven/.m2 -it --rm -u $(id -u) -e MAVEN_CONFIG=/var/maven/.m2 maven mvn -Duser.home=/var/maven archetype:generate

Image Variants

The maven images come in many flavors, each designed for a specific use case.

maven:<version>

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.

Installed Packages

The following packages are currently installed in each variant. Some come from the parent images and some are installed in this image for backwards compatibility.

git curl tar bash which gzip procps gpg ssh
amazoncorretto-8 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-8-al2023 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-8-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-11 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-11-al2023 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-11-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-17 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-17-al2023 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-17-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-21 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-21-al2023 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
amazoncorretto-21-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-8 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-8-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-8-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-11 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-11-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-11-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-17 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-17-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-17-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-21 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-21-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
azulzulu-21-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-8 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-8-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-8-focal ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-11 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-11-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-11-focal ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-17 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-17-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-17-focal ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-21 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-21-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-22-jammy ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-22 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-22-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
eclipse-temurin-22-jammy ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
graalvm-community-17 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
graalvm-community-21 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
ibm-semeru-11-focal ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
ibm-semeru-17-focal ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
ibm-semeru-21-jammy ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
ibmjava-8 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
libericaopenjdk-8-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
libericaopenjdk-8-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
libericaopenjdk-11-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
libericaopenjdk-11-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
libericaopenjdk-17-alpine ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
libericaopenjdk-17-debian ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
microsoft-openjdk-11-ubuntu ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
microsoft-openjdk-17-ubuntu ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
microsoft-openjdk-21-ubuntu ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
oracle-graalvm-17 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
oracle-graalvm-21 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
sapmachine-11 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
sapmachine-17 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
sapmachine-21 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎
sapmachine-22 ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎ ✔︎

Image Verification

Images under csanchez/maven and ghcr.io/carlossg/maven are signed with sigstore/cosign using GitHub OIDC

Verification can be done with cosign verify

Example:

COSIGN_EXPERIMENTAL=true cosign verify csanchez/maven:3-eclipse-temurin-17

Building

Build with the usual

docker build -t maven .

Tests are written using bats for Linux images and pester for Windows images under the tests dir.

Use the env var TAG to choose what image to run tests against.

Linux

TAG=eclipse-temurin-17 bats tests

Windows

$env:TAG="openjdk-11" ; Invoke-Pester -Path tests

or run all the tests with

Linux

for dir in $(/bin/ls -1 -d */ | grep -v 'tests\|windows'); do TAG=$(basename $dir) bats tests; done

Windows

Get-ChildItem -File -Include "*windows*" | ForEach-Object { Push-Location ; $env:TAG=$_.Name ; Invoke-Pester -Path tests ; Pop-Location }

Bats can be easily installed with brew install bats-core on OS X.

Note that you may first need to:

git submodule init
git submodule update

Pester comes with most modern Windows (Windows 10 and Windows Server 2019), but is an older version than required.

Adding New Images

  • Copy an existing dir (other than eclipse-temurin-11) to the new name and update Dockerfile as needed.
  • Update README.md to include the new image and table with packages installed in that image.
  • When adding a new JDK then it also needs to be added to the beginning of common.sh
  • Run github-action-generation.sh to generate new GitHub Actions for the new image
  • When a parent image changes the latest tag to a new JDK version it can be updated in common.sh

Updating Maven version

  • Search and replace all references to the previous version by the new version.
  • Update environment variable SHA in eclipse-temurin-17/Dockerfile with value found in maven download page for the binary tar.gz archive.
  • Update environment variable SHA in *-{nanoserver,windowsservercore}/Dockerfile with value found in maven download page for the binary zip archive.

Publishing to Docker Hub

In order to publish the images a PR needs to be opened against docker-library/official-images

For that we use publish.sh that runs generate-stackbrew-library.sh

License

View license information for the software contained in this image.

User Feedback

Issues

If you have any problems with or questions about this image, please contact us through a GitHub issue.

You can also reach many of the official image maintainers via the #docker-library IRC channel on Libera.Chat (web) or in your favorite IRC client.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.