This repository contains the container images used by Quarkus.
NOTE: Require CEKit 3.10.x
The images are available on Quay.io
- ubi-quarkus-native-image - provides the
native-imageexecutable. Used by the Maven and Gradle plugin from Quarkus to build linux64 executables - ubi-quarkus-mandrel - provides the
native-imageexecutable from the Mandrel distribution of GraalVM. Used by the Maven and Gradle plugin from Quarkus to build linux64 executables - centos-quarkus-maven - Image delivering GraalVM, Maven, Gradle, Podman and Buildah; this image can be used to build a native executable from source.
- ubi-quarkus-native-s2i - S2I builder image for OpenShift building a native image from source code (using Gradle or Maven)
- ubi-quarkus-native-binary-s2i - S2I builder image for OpenShift taking a pre-built native executable as input
To pull these images use:
docker pull quay.io/quarkus/ubi-quarkus-native-image:VERSIONdocker pull quay.io/quarkus/ubi-quarkus-mandrel:VERSIONdocker pull quay.io/quarkus/centos-quarkus-maven:VERSIONdocker pull quay.io/quarkus/ubi-quarkus-native-s2i:VERSIONdocker pull quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0
with VERSION being the version.
The version matches the GraalVM version used in the image, for example: 21.1.0-java11, 21.1.0-java16...
quay.io/quarkus/ubi-quarkus-native-s2i:21.1.0-java11 <-- GraalVM 21.1.0 with java 11 support
quay.io/quarkus/ubi-quarkus-native-s2i:21.1.0-java16 <-- GraalVM 21.1.0 with java 16 support
quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0 <-- Native binary s2iNOTE: You may wonder why we don't use latest. It's because latest has introduced more problems than benefits especially when reproducing issues.
For this reason, we recommend using a stable version.
To build you need CEKit. We recommend using virtualenv to run cekit.
On MacOS X and Linux, you can run the build as follows:
virtualenv --python=python3 .cekit
source .cekit/bin/activate
pip install -r requirements.txt
# Run the scripts from the .github directory
# i.e. .github/build-native-images.shFor other Systems, please refer to the CEKit docs.
s2i are needed for tests, download your OS version from https://github.com/openshift/source-to-image/releases/latest and put it in s2i folder.
Something like the following:
mkdir s2i
cd s2i
tar -zxvf source-to-image-*.tar.gzThe build is controlled by 5 image files:
quarkus-native-image.yamlproducesubi-quarkus-native-imageimagesquarkus-mandrel.yamlproducesubi-quarkus-mandrelimagesquarkus-micro-image.yamlproduces thequarkus-micro-imageimage, a runtime image to execute your native executablequarkus-native-binary-s2i.yamlproduces theubi-quarkus-native-binary-s2iimagequarkus-native-s2i.yamlproduces theubi-quarkus-native-s2iimagesquarkus-tooling.yamlproduces thecentos-quarkus-mavenimages (deprecated)
To build the images, you must pass the "GraalVM" version as parameter (except for quarkus-mandrel.yaml, quarkus-native-binary-s2i.yaml and quarkus-micro-image.yaml):
cekit --descriptor ${IMAGE} build \
--overrides "{'version': '${version}', 'modules': {'install': [{'name':'graalvm', 'version': '${version}'}]}}" \
docker --tag="${IMAGE_NAME}:${version}"For quarkus-mandrel.yaml you must pass the "Mandrel" version instead:
cekit --descriptor ${IMAGE} build \
--overrides "{'version': '${version}', 'modules': {'install': [{'name':'mandrel', 'version': '${version}'}]}}" \
docker --tag="${IMAGE_NAME}:${version}"The .github directory contains the script to build the different images.
Run the scripts from the .github directory
This image provides GRAALVM and the native-image executable. It is used by the Quarkus Maven plugin and Quarkus Gradle plugin to generate linux 64 executable.
S2I (Source to Image) are builder images used by OpenShift to build image streams. Two S2I are available:
- GraalVM Native S2I - build your source code using Maven or Gradle and create a new container image from the produced native executable.
- Binary S2I - build a new container image from a provided native executable. This executable is generally built on your machine, and uploaded.
Both resulting containers are based on UBI images.
For more information about this image, please refer to its module README: centos-quarkus-maven
IMPORTANT: The images are produced both the last 2 versions of GraalVM. For most images, this version defines the image tag (i.e. version)
- Create new directories under
modules/graalvmnamed after the new version. You need to create 2 directories to distinguish the java versions, e.g.java11andjava16. - In each directory, write the
configureandmodule.yamlfiles. Theconfigurefile should not differ from the existing versions, so just copy it. In themodule.yaml, change the versions, labels, sha256 hash... - In the
.githubdirectory, edit thenative-images.yaml,mandrel-images.yaml,s2i-native-images.yamlandtooling-images.yamlto add/replace versions in theversionslist. If needed, also update thatagslist.
IMPORTANT: Always keep the last GraalVM LTS.
- Create a new directory under
modules/maven-binary/modules/gradle-binarynamed after the new version - In the new directory, create (or copy from an existing version) the
configureandmodule.yamlfile - Edit the
module.yamlfile to target the new version - Edit the
quarkus-native-s2i.yamlandquarkus-tooling.yamlfiles to update the Maven/Gradle version
Before proceeding make sure you have CEKit installed, see build.
The build scripts are located in the .github directory:
build-distroless-images.sh- build the distroless images suitable for packaging native applications (experimental)build-mandrel-images.sh- build the mandrel imagesbuild-micro-images.sh- build the micro images suitable for packaging native applications on an UBI based imagebuild-native-images.sh- build the images providing thenative-imageexecutablebuild-s2i-binary-images.sh- build the s2i builder images taking a pre-built native executablebuild-s2i-native-images.sh- build the s2i builder images taking Java sources as input and building the native executable and the containerbuild-tooling-images.sh- build the tooling image (deprecated)
Except build-s2i-binary-images.sh, the other scripts expect the GraalVM/Mandrel version as unique parameter:
> .github/build-native-images.sh 20.2.0-java11This repository uses GitHub Actions to build the images.
On each PR, the images are built. Check the Actions tab in the GitHub project.
To push the images to Quay, you need to trigger a deployment. Once the images have been built from master successfully, issue the following cURL command:
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.ant-man-preview+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/quarkusio/quarkus-images/deployments \
--data '{"ref": "main", "environment": "quay"}'Note that you need a GITHUB_TOKEN (API token) to trigger the deployment.