From 2ec831677a0103a2c82daee358691c5f420c0a83 Mon Sep 17 00:00:00 2001 From: jclausen Date: Wed, 26 Jun 2024 14:32:06 -0400 Subject: [PATCH] add JDK21 and Boxlang builds --- .github/workflows/pull-request.yml | 6 +++ .github/workflows/release.yml | 6 +++ builds/alpine/BoxLang.Dockerfile | 11 +++++ builds/base/Alpine.JDK21.Dockerfile | 75 +++++++++++++++++++++++++++++ builds/base/JDK21.Dockerfile | 68 ++++++++++++++++++++++++++ builds/base/ubi9.JDK21.Dockerfile | 72 +++++++++++++++++++++++++++ builds/debian/BoxLang.Dockerfile | 11 +++++ builds/ubi9/BoxLang.Dockerfile | 11 +++++ 8 files changed, 260 insertions(+) create mode 100644 builds/alpine/BoxLang.Dockerfile create mode 100644 builds/base/Alpine.JDK21.Dockerfile create mode 100644 builds/base/JDK21.Dockerfile create mode 100644 builds/base/ubi9.JDK21.Dockerfile create mode 100644 builds/debian/BoxLang.Dockerfile create mode 100644 builds/ubi9/BoxLang.Dockerfile diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 796e9e9..0f1aaff 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -31,6 +31,8 @@ jobs: BUILD_IMAGE_TAG: adobe2018 - BUILD_IMAGE_DOCKERFILE: builds/debian/Adobe2021.Dockerfile BUILD_IMAGE_TAG: adobe2021 + - BUILD_IMAGE_DOCKERFILE: builds/debian/BoxLang.Dockerfile + BUILD_IMAGE_TAG: boxlang # ubi9 Builds - BUILD_IMAGE_DOCKERFILE: builds/ubi9/Base.Dockerfile @@ -47,6 +49,8 @@ jobs: BUILD_IMAGE_TAG: adobe2018-ubi9 - BUILD_IMAGE_DOCKERFILE: builds/ubi9/Adobe2021.Dockerfile BUILD_IMAGE_TAG: adobe2021-ubi9 + - BUILD_IMAGE_DOCKERFILE: builds/ubi9/BoxLang.Dockerfile + BUILD_IMAGE_TAG: boxlang-ubi9 # Alpine builds # Note: No JDK builders currently support alpine with ARM @@ -66,6 +70,8 @@ jobs: BUILD_IMAGE_TAG: adobe2018-alpine - BUILD_IMAGE_DOCKERFILE: builds/alpine/Adobe2021.Dockerfile BUILD_IMAGE_TAG: adobe2021-alpine + - BUILD_IMAGE_DOCKERFILE: builds/alpine/BoxLang.Dockerfile + BUILD_IMAGE_TAG: boxlang-alpine steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8166aa8..d25ef6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,8 @@ jobs: BUILD_IMAGE_TAG: adobe2021 - BUILD_IMAGE_DOCKERFILE: builds/debian/Adobe2023.Dockerfile BUILD_IMAGE_TAG: adobe2023 + - BUILD_IMAGE_DOCKERFILE: builds/debian/BoxLang.Dockerfile + BUILD_IMAGE_TAG: boxlang # ubi9 Builds - BUILD_IMAGE_DOCKERFILE: builds/ubi9/Base.Dockerfile @@ -62,6 +64,8 @@ jobs: BUILD_IMAGE_TAG: adobe2021-ubi9 - BUILD_IMAGE_DOCKERFILE: builds/ubi9/Adobe2023.Dockerfile BUILD_IMAGE_TAG: adobe2023-ubi9 + - BUILD_IMAGE_DOCKERFILE: builds/ubi9/BoxLang.Dockerfile + BUILD_IMAGE_TAG: boxlang-ubi9 # Alpine builds # Note: No JDK builders currently support alpine with ARM @@ -89,6 +93,8 @@ jobs: BUILD_IMAGE_TAG: adobe2021-alpine - BUILD_IMAGE_DOCKERFILE: builds/alpine/Adobe2023.Dockerfile BUILD_IMAGE_TAG: adobe2023-alpine + - BUILD_IMAGE_DOCKERFILE: builds/alpine/BoxLang.Dockerfile + BUILD_IMAGE_TAG: boxlang-alpine steps: - name: Checkout diff --git a/builds/alpine/BoxLang.Dockerfile b/builds/alpine/BoxLang.Dockerfile new file mode 100644 index 0000000..0f9f4a0 --- /dev/null +++ b/builds/alpine/BoxLang.Dockerfile @@ -0,0 +1,11 @@ +# syntax = edrevo/dockerfile-plus +INCLUDE+ builds/base/Alpine.JDK21.Dockerfile + +LABEL maintainer "Jon Clausen " +LABEL repository "https://github.com/Ortus-Solutions/docker-commandbox" + +RUN box install commandbox-boxlang + +ENV BOX_SERVER_APP_CFENGINE boxlang + +RUN ${BUILD_DIR}/util/warmup-server.sh diff --git a/builds/base/Alpine.JDK21.Dockerfile b/builds/base/Alpine.JDK21.Dockerfile new file mode 100644 index 0000000..fa67af0 --- /dev/null +++ b/builds/base/Alpine.JDK21.Dockerfile @@ -0,0 +1,75 @@ +FROM eclipse-temurin:21-jdk-alpine + +ARG VERSION +ARG COMMANDBOX_VERSION + +LABEL version ${VERSION} +LABEL maintainer "Jon Clausen " +LABEL repository "https://github.com/Ortus-Solutions/docker-commandbox" + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# Since alpine runs as a single user, we need to create a "root" direcotry +ENV HOME /root + +# Alpine workgroup is root group +ENV WORKGROUP root + +# Flag as an alpine release +RUN touch /etc/alpine-release + +### Directory Mappings ### + +# BIN_DIR = Where the box binary goes +ENV BIN_DIR /usr/bin +# LIB_DIR = Where the build files go +ENV LIB_DIR /usr/lib +WORKDIR $BIN_DIR + +# APP_DIR = the directory where the application runs +ENV APP_DIR /app +WORKDIR $APP_DIR + +# BUILD_DIR = WHERE runtime scripts go +ENV BUILD_DIR $LIB_DIR/build +WORKDIR $BUILD_DIR + +# COMMANDBOX_HOME = Where CommmandBox Lives +ENV COMMANDBOX_HOME=$LIB_DIR/CommandBox + +# Copy file system +COPY ./test/ ${APP_DIR}/ +COPY ./build/ ${BUILD_DIR}/ +# Ensure all workgroup users have permission on the build scripts +RUN chown -R nobody:${WORKGROUP} $BUILD_DIR +RUN chmod -R +x $BUILD_DIR + + +# Basic Dependencies including binaries for PDF rendering +RUN rm -rf $BUILD_DIR/util/debian +RUN rm -rf $BUILD_DIR/util/ubi9 +RUN $BUILD_DIR/util/alpine/install-dependencies.sh + +# Commandbox Installation +RUN $BUILD_DIR/util/install-commandbox.sh + +# Add our custom classes added in the previous step to the java classpath +ENV CLASSPATH="$JAVA_HOME/classes" + +# Default Port Environment Variables +ENV PORT 8080 +ENV SSL_PORT 8443 + + +# Healthcheck environment variables +ENV HEALTHCHECK_URI "http://127.0.0.1:${PORT}/" + +# Our healthcheck interval doesn't allow dynamic intervals - Default is 20s intervals with 15 retries +HEALTHCHECK --interval=20s --timeout=30s --retries=15 CMD curl --fail ${HEALTHCHECK_URI} || exit 1 + +EXPOSE ${PORT} ${SSL_PORT} + +WORKDIR $APP_DIR + +CMD $BUILD_DIR/run.sh diff --git a/builds/base/JDK21.Dockerfile b/builds/base/JDK21.Dockerfile new file mode 100644 index 0000000..80a21b2 --- /dev/null +++ b/builds/base/JDK21.Dockerfile @@ -0,0 +1,68 @@ +FROM eclipse-temurin:21-jdk-jammy +ARG COMMANDBOX_VERSION + +LABEL maintainer "Jon Clausen " +LABEL repository "https://github.com/Ortus-Solutions/docker-commandbox" + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# Since alpine runs as a single user, we need to create a "root" direcotry +ENV HOME /root + +# Add a working group which any dynamic users can be assigned +ENV WORKGROUP runwar +RUN groupadd $WORKGROUP && usermod -a -G $WORKGROUP root + +### Directory Mappings ### +# BIN_DIR = Where the box binary goes +ENV BIN_DIR /usr/local/bin +# LIB_DIR = Where the build files go +ENV LIB_DIR /usr/local/lib +WORKDIR $BIN_DIR + +# BUILD_DIR = WHERE runtime scripts go +ENV BUILD_DIR $LIB_DIR/build +WORKDIR $BUILD_DIR + +# COMMANDBOX_HOME = Where CommmandBox Lives +ENV COMMANDBOX_HOME=$LIB_DIR/CommandBox + +# APP_DIR = the directory where the application runs +ENV APP_DIR /app +WORKDIR $APP_DIR + +# Copy file system +COPY ./test/ ${APP_DIR}/ +COPY ./build/ ${BUILD_DIR}/ +RUN chmod +x $BUILD_DIR/*.sh + +# Ensure all runwar users have permission on the build scripts +RUN chown -R $(whoami):${WORKGROUP} $BUILD_DIR + + +# Basic Dependencies +RUN rm -rf $BUILD_DIR/util/alpine +RUN rm -rf $BUILD_DIR/util/ubi9 +RUN ${BUILD_DIR}/util/debian/install-dependencies.sh + +# Commandbox Installation +RUN $BUILD_DIR/util/install-commandbox.sh + +# Add our custom classes added in the previous step to the java classpath +ENV CLASSPATH="$JAVA_HOME/classes" + + +# Default Port Environment Variables +ENV PORT 8080 +ENV SSL_PORT 8443 + +# Healthcheck environment variables +ENV HEALTHCHECK_URI "http://127.0.0.1:${PORT}/" + +# Our healthcheck interval doesn't allow dynamic intervals - Default is 20s intervals with 15 retries +HEALTHCHECK --interval=20s --timeout=30s --retries=15 CMD curl --fail ${HEALTHCHECK_URI} || exit 1 + +EXPOSE ${PORT} ${SSL_PORT} + +CMD $BUILD_DIR/run.sh diff --git a/builds/base/ubi9.JDK21.Dockerfile b/builds/base/ubi9.JDK21.Dockerfile new file mode 100644 index 0000000..41c8a36 --- /dev/null +++ b/builds/base/ubi9.JDK21.Dockerfile @@ -0,0 +1,72 @@ +FROM eclipse-temurin:21-jdk-ubi9-minimal + +ARG COMMANDBOX_VERSION + +LABEL maintainer "Jon Clausen " +LABEL repository "https://github.com/Ortus-Solutions/docker-commandbox" + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# Since alpine runs as a single user, we need to create a "root" direcotry +ENV HOME /root + +RUN microdnf install -y shadow-utils util-linux + +# Add a working group which any dynamic users can be assigned +ENV WORKGROUP runwar +RUN groupadd $WORKGROUP && usermod -a -G $WORKGROUP root + +### Directory Mappings ### +# BIN_DIR = Where the box binary goes +ENV BIN_DIR /usr/local/bin +# LIB_DIR = Where the build files go +ENV LIB_DIR /usr/local/lib +WORKDIR $BIN_DIR + +# BUILD_DIR = WHERE runtime scripts go +ENV BUILD_DIR $LIB_DIR/build +WORKDIR $BUILD_DIR + +# COMMANDBOX_HOME = Where CommmandBox Lives +ENV COMMANDBOX_HOME=$LIB_DIR/CommandBox + +# APP_DIR = the directory where the application runs +ENV APP_DIR /app +WORKDIR $APP_DIR + +# Copy file system +COPY ./test/ ${APP_DIR}/ +COPY ./build/ ${BUILD_DIR}/ +RUN chmod +x $BUILD_DIR/*.sh + +# Ensure all runwar users have permission on the build scripts +RUN chown -R $(whoami):${WORKGROUP} $BUILD_DIR + + +# Basic Dependencies +RUN rm -rf $BUILD_DIR/util/alpine +RUN rm -rf $BUILD_DIR/util/debian + +RUN ${BUILD_DIR}/util/ubi9/install-dependencies.sh + +# Commandbox Installation +RUN $BUILD_DIR/util/install-commandbox.sh + +# Add our custom classes added in the previous step to the java classpath +ENV CLASSPATH="$JAVA_HOME/classes" + +# Default Port Environment Variables +ENV PORT 8080 +ENV SSL_PORT 8443 + + +# Healthcheck environment variables +ENV HEALTHCHECK_URI "http://127.0.0.1:${PORT}/" + +# Our healthcheck interval doesn't allow dynamic intervals - Default is 20s intervals with 15 retries +HEALTHCHECK --interval=20s --timeout=30s --retries=15 CMD curl --fail ${HEALTHCHECK_URI} || exit 1 + +EXPOSE ${PORT} ${SSL_PORT} + +CMD $BUILD_DIR/run.sh diff --git a/builds/debian/BoxLang.Dockerfile b/builds/debian/BoxLang.Dockerfile new file mode 100644 index 0000000..1b52133 --- /dev/null +++ b/builds/debian/BoxLang.Dockerfile @@ -0,0 +1,11 @@ +# syntax = edrevo/dockerfile-plus +INCLUDE+ builds/base/JDK21.Dockerfile + +LABEL maintainer "Jon Clausen " +LABEL repository "https://github.com/Ortus-Solutions/docker-commandbox" + +RUN box install commandbox-boxlang + +ENV BOX_SERVER_APP_CFENGINE boxlang + +RUN ${BUILD_DIR}/util/warmup-server.sh diff --git a/builds/ubi9/BoxLang.Dockerfile b/builds/ubi9/BoxLang.Dockerfile new file mode 100644 index 0000000..1f904f1 --- /dev/null +++ b/builds/ubi9/BoxLang.Dockerfile @@ -0,0 +1,11 @@ +# syntax = edrevo/dockerfile-plus +INCLUDE+ builds/base/ubi9.JDK21.Dockerfile + +LABEL maintainer "Jon Clausen " +LABEL repository "https://github.com/Ortus-Solutions/docker-commandbox" + +RUN box install commandbox-boxlang + +ENV BOX_SERVER_APP_CFENGINE boxlang + +RUN ${BUILD_DIR}/util/warmup-server.sh