Skip to content

Commit

Permalink
OPSEXP-2239 Provide a rockylinux 9 java base image (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
slohe1 authored Sep 20, 2023
1 parent d3f5e3c commit d079bbf
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,22 @@ jobs:
major: 7
- flavor: rockylinux
major: 8
- flavor: rockylinux
major: 9
java_major:
- 11
- 17
jdist:
- jre
- jdk
exclude:
- base_image:
flavor: centos
major: 7
java_major: 17
- base_image:
flavor: rockylinux
major: 9
java_major: 11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
44 changes: 23 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,14 @@ ENV LC_ALL en_US.UTF-8

RUN set -eux; \
yum update --security -y && \
if [ "$JDIST" = 'jdk' ]; then \
REPO_FILE="/etc/yum.repos.d/adoptium.repo" && \
echo "[Adoptium]" >> $REPO_FILE && \
echo "name=Adoptium" >> $REPO_FILE && \
echo "enabled=1" >> $REPO_FILE && \
echo "gpgcheck=1" >> $REPO_FILE && \
echo "gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public" >> $REPO_FILE && \
echo "baseurl=https://packages.adoptium.net/artifactory/rpm/centos/7/$(uname -m)" >> $REPO_FILE && \
yum install -y temurin-${JAVA_MAJOR}-${JDIST}; \
else \
ARCH=$(uname -m | sed s/86_//) && \
if [ $JAVA_MAJOR -eq 11 ]; then JAVA_VERSION="11.0.15_10" ; fi && \
if [ $JAVA_MAJOR -eq 17 ]; then JAVA_VERSION="17.0.3_7" ; fi && \
curl -fsLo java.tar.gz https://github.com/adoptium/temurin${JAVA_MAJOR}-binaries/releases/download/jdk-${JAVA_VERSION/_/%2B}/OpenJDK${JAVA_MAJOR}U-${JDIST}_${ARCH}_linux_hotspot_${JAVA_VERSION}.tar.gz && \
tar xvfz java.tar.gz && \
mkdir -p /usr/lib/jvm && \
mv jdk-* ${JAVA_HOME} && \
update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 1; \
fi && \
ARCH=$(uname -m | sed s/86_//) && \
if [ $JAVA_MAJOR -eq 11 ]; then JAVA_VERSION="11.0.15_10" ; fi && \
if [ $JAVA_MAJOR -eq 17 ]; then JAVA_VERSION="17.0.3_7" ; fi && \
curl -fsLo java.tar.gz https://github.com/adoptium/temurin${JAVA_MAJOR}-binaries/releases/download/jdk-${JAVA_VERSION/_/%2B}/OpenJDK${JAVA_MAJOR}U-${JDIST}_${ARCH}_linux_hotspot_${JAVA_VERSION}.tar.gz && \
tar xvfz java.tar.gz && \
mkdir -p /usr/lib/jvm && \
mv jdk-* ${JAVA_HOME} && \
update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 1; \
yum clean all && rm -rf /var/cache/yum

FROM rockylinux:8.8.20230518 AS rockylinux8
Expand All @@ -45,8 +34,21 @@ ENV LC_ALL C.UTF-8

RUN \
yum update --security -y && \
if [ "$JDIST" = 'jdk' ]; then JAVA_PKG_TYPE="devel"; else JAVA_PKG_TYPE="headless"; fi && \
yum install -y langpacks-en java-${JAVA_MAJOR}-openjdk-${JAVA_PKG_TYPE} && \
yum install -y langpacks-en java-${JAVA_MAJOR}-openjdk-headless && \
yum clean all && rm -rf /var/cache/yum

FROM rockylinux:9.2.20230513 AS rockylinux9

ARG JDIST
ARG JAVA_MAJOR

ENV JAVA_HOME /etc/alternatives/jre
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

RUN \
yum update --security -y && \
yum install -y langpacks-en java-${JAVA_MAJOR}-openjdk-headless && \
yum clean all && rm -rf /var/cache/yum

FROM ${DISTRIB_NAME}${DISTRIB_MAJOR} AS JAVA_BASE_IMAGE
Expand Down
24 changes: 9 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Alfresco Docker Base Java [![Build Status](https://img.shields.io/github/actions/workflow/status/Alfresco/alfresco-docker-base-java/main.yml?branch=master)](https://github.com/Alfresco/alfresco-docker-base-java/actions/workflows/main.yml)

This repository contains the [Dockerfile](Dockerfile) used to create the base
Java image based on Centos 7 that will be used by Alfresco engineering teams,
Java image based on Centos 7, Rocky Linux 8 & Rocky Linux 9 that will be used by Alfresco engineering teams,
other internal groups in the organization, customers and partners to create Java
images from.

Please be aware that:

* `jdk` flavoured builds are provided only for development purposes and are not
meant to be used in production, please use the lighter `jre` flavour.
* we are providing jre images based on different OS but at the time of writing
only `jre11-centos7` is passing security scan on our private quay.io. You can
check for updated security scans results on the quay.io [image
Expand All @@ -21,18 +19,14 @@ Choose between one of the available flavours built from this repository:
Java version | Java flavour | OS | Image tag | Size
-------------|--------------|---------------|-------------------|-----------------------------
11 | jre | Centos 7 | jre11-centos7 | ![jre11-centos7 size][1]
11 | jdk | Centos 7 | jdk11-centos7 | ![jdk11-centos7 size][2]
17 | jre | Rocky Linux 8 | jre17-rockylinux8 | ![jre17-rockylinux8 size][3]
17 | jdk | Rocky Linux 8 | jdk17-rockylinux8 | ![jdk17-rockylinux8 size][4]
11 | jre | Rocky Linux 8 | jre11-rockylinux8 | ![jre11-rockylinux8 size][5]
11 | jdk | Rocky Linux 8 | jdk11-rockylinux8 | ![jdk11-rockylinux8 size][6]
17 | jre | Rocky Linux 8 | jre17-rockylinux8 | ![jre17-rockylinux8 size][2]
11 | jre | Rocky Linux 8 | jre11-rockylinux8 | ![jre11-rockylinux8 size][3]
17 | jre | Rocky Linux 9 | jre17-rockylinux9 | ![jre17-rockylinux9 size][4]

[1]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jre11-centos7
[2]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jdk11-centos7
[3]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jre17-rockylinux8
[4]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jdk17-rockylinux8
[5]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jre11-rockylinux8
[6]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jdk11-rockylinux8
[2]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jre17-rockylinux8
[3]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jre11-rockylinux8
[4]: https://img.shields.io/docker/image-size/alfresco/alfresco-base-java/jre17-rockylinux9

* [Docker Hub](https://hub.docker.com/r/alfresco/alfresco-base-java) image name: `alfresco/alfresco-base-java`
* [Quay](https://quay.io/repository/alfresco/alfresco-base-java) image name: `quay.io/alfresco/alfresco-base-java`
Expand Down Expand Up @@ -96,7 +90,7 @@ The `alfresco-docker-base-java` image can be generated in multiple flavors by mi

Either Java 11 or Java 17 can be used to build images using the `JAVA_MAJOR` build argument.

> Both OpenJDK versions bellow can be built from the JDK or the JRE distribution (using the JDIST build argument)
> OpenJDK versions below can be built from the JRE distribution (using the JDIST build argument)
##### Legacy OpenJDK Java 11

Expand All @@ -112,7 +106,7 @@ The possible combination of OS versions are available:

* centos 7
* rockylinux 8
* alpine 3.15
* rockylinux 9

### How to build an image locally

Expand Down

0 comments on commit d079bbf

Please sign in to comment.