From 4cfaa9039ebb338650719fde0dd0c52567116cf8 Mon Sep 17 00:00:00 2001 From: Kaur Palang Date: Tue, 6 Oct 2026 16:01:49 -0400 Subject: [PATCH 1/5] Generate Dockerfiles and compose files from gomplate templates Replace the single deploy/ Dockerfile, .env and compose file with gomplate templates driven by releases.yaml. render_docker_templates.sh renders one dockerfiles// directory per release, and the build workflow builds and pushes each rendered version as a matrix job. The other changes in this commit: - The 4.5.2 images use the eclipse-temurin 17.0.20.1_1 base images (up from 17.0.15_6) and are still on Ubuntu noble. - The downloader stage uses alpine 3.24.1. - Images are built for linux/amd64 and linux/arm64 (the published images are amd64 only). - File ownership is set in the COPY layer, not with a separate chown layer. - The engine user is UID/GID 1000. On Ubuntu, the base image's "ubuntu" user and group are renamed to "engine". This matches every image published to openintegrationengine/engine so far, even though the deploy/Dockerfile being replaced used 14285. - The workflow pushes straight from `docker compose build --push`, runs only when dockerfiles/** changes, uses a concurrency group and the "dockerhub" environment, and uses newer action versions. Adapted from BrightCodeCompany/engine-docker@450d8c0 (MPL-2.0). Source commits: e100278 da28677 ea559ac 5a68694 fcd9f13 7c0d960 bc84ea7 93b1354 eb62f99 3dd65d5 06b80cf 7e9b58e 5e2705f 329f7d1 479262c 4aa12bc 9dc5706 8039bb1 4dc95ef 01c7da5 b06e24e 7f43815 e8b9506 1b64fad 163232b f8d0138 3bdcb1c 19940d1 (UID/GID 1000 originally from 07d6ff2 on BCC's hotfix/replace-user-ids) Modifications from the BCC version: - releases.yaml: OCI authors/vendor labels set to The Open Integration Engine Project, and the source label to OpenIntegrationEngine/engine-docker. Only 4.5.2 is listed (BCC also has 4.6.0-rc1 and 4.6.0), and latest is set to 4.5.2. 4.5.2 base images are 17.0.20.1_1-{jre,jdk}-{noble,alpine} (BCC: 21.0.11_10, Ubuntu resolute). Added a comment explaining that uid/gid must match the Ubuntu base image's "ubuntu" user. - templates/Dockerfile.tpl: a blank line now separates the downloader stage from the first final stage in the rendered output. - templates/compose.yaml.tpl: image repository is openintegrationengine/engine (BCC: brightcodecompany/openintegrationengine). The - tag is only on the JRE images (BCC: on both the JRE and JDK images, so the two pushes overwrite each other). Services are indented two spaces, with no trailing whitespace between them. - render_docker_templates.sh: added a bash shebang, the MPL-2.0 SPDX license identifier and `set -e`. It now copies templates/entrypoint.sh into each rendered directory (BCC copied it by hand). It changes to its own directory first, and deletes dockerfiles/ before rendering so versions removed from releases.yaml do not leave stale output. - .github/workflows/build-and-deploy-images.yaml: matrix is only 4.5.2. fail-fast is off, so a failure in one version's job does not cancel the other versions mid-push. - README.md: only the "Building images" path changed (deploy/ to dockerfiles//). - .dockerignore: not carried over. Each build context is dockerfiles//, so a root .dockerignore has no effect. - templates/entrypoint.sh: unchanged (moved from deploy/entrypoint.sh). - dockerfiles/4.5.2/*: rendered output. Signed-off-by: Kaur Palang Co-authored-by: Tony Germano Signed-off-by: Tony Germano --- ...mage.yaml => build-and-deploy-images.yaml} | 33 ++- README.md | 2 +- deploy/.dockerignore | 2 - deploy/.env | 8 - deploy/Dockerfile | 112 -------- deploy/compose.yaml | 69 ----- dockerfiles/4.5.2/Dockerfile | 158 +++++++++++ dockerfiles/4.5.2/compose.yaml | 61 +++++ {deploy => dockerfiles/4.5.2}/entrypoint.sh | 0 releases.yaml | 40 +++ render_docker_templates.sh | 22 ++ templates/Dockerfile.tpl | 82 ++++++ templates/compose.yaml.tpl | 50 ++++ templates/entrypoint.sh | 245 ++++++++++++++++++ 14 files changed, 679 insertions(+), 205 deletions(-) rename .github/workflows/{deploy-image.yaml => build-and-deploy-images.yaml} (53%) delete mode 100644 deploy/.dockerignore delete mode 100644 deploy/.env delete mode 100644 deploy/Dockerfile delete mode 100644 deploy/compose.yaml create mode 100644 dockerfiles/4.5.2/Dockerfile create mode 100644 dockerfiles/4.5.2/compose.yaml rename {deploy => dockerfiles/4.5.2}/entrypoint.sh (100%) create mode 100644 releases.yaml create mode 100755 render_docker_templates.sh create mode 100644 templates/Dockerfile.tpl create mode 100644 templates/compose.yaml.tpl create mode 100755 templates/entrypoint.sh diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/build-and-deploy-images.yaml similarity index 53% rename from .github/workflows/deploy-image.yaml rename to .github/workflows/build-and-deploy-images.yaml index 2af9e6b..e5c1f18 100644 --- a/.github/workflows/deploy-image.yaml +++ b/.github/workflows/build-and-deploy-images.yaml @@ -5,34 +5,41 @@ on: push: branches: - main + paths: + - dockerfiles/** + +concurrency: build-images jobs: build-images: runs-on: ubuntu-latest + environment: dockerhub + strategy: + fail-fast: false + matrix: + oie_version: + - 4.5.2 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Set up Docker Compose - uses: docker/setup-compose-action@v1 - - - name: Build images - working-directory: deploy - run: | - docker compose --progress plain build --build-arg CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - docker image ls + uses: docker/setup-compose-action@v2 - name: Login to Docker Hub - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push images to Docker hub - run: docker image push --all-tags openintegrationengine/engine + - name: Build images + working-directory: dockerfiles/${{ matrix.oie_version }} + run: | + docker compose --progress plain build --build-arg CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") --push + docker image ls diff --git a/README.md b/README.md index 6af5e3d..d7691ca 100644 --- a/README.md +++ b/README.md @@ -441,7 +441,7 @@ Example: ## Building images -To build the full set of four images (`ubuntu-jre`, `ubuntu-jdk`, `alpine-jre`, and `alpine-jdk`) run the following command in the `deploy/` directory: +To build the full set of four images (`ubuntu-jre`, `ubuntu-jdk`, `alpine-jre`, and `alpine-jdk`) run the following command in the `dockerfiles//` directory: ```sh docker compose build --build-arg CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") ``` diff --git a/deploy/.dockerignore b/deploy/.dockerignore deleted file mode 100644 index 864179f..0000000 --- a/deploy/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!entrypoint.sh diff --git a/deploy/.env b/deploy/.env deleted file mode 100644 index 5284572..0000000 --- a/deploy/.env +++ /dev/null @@ -1,8 +0,0 @@ -UBUNTU_JRE_TAG=17.0.15_6-jre-noble -UBUNTU_JDK_TAG=17.0.15_6-jdk-noble - -ALPINE_JRE_TAG=17.0.15_6-jre-alpine -ALPINE_JDK_TAG=17.0.15_6-jdk-alpine - -OIE_RELEASE_VERSION=4.5.2-tp.1 -OIE_RELEASE_URL=https://github.com/OpenIntegrationEngine/engine/releases/download/v4.5.2-tp.1/oie_unix_4_5_2.tar.gz diff --git a/deploy/Dockerfile b/deploy/Dockerfile deleted file mode 100644 index cceff2b..0000000 --- a/deploy/Dockerfile +++ /dev/null @@ -1,112 +0,0 @@ -# syntax=docker/dockerfile:1 - -ARG BASE_IMAGE_TAG - -ARG OIE_RELEASE_VERSION - -ARG UID=14285 -ARG GID=14285 - -FROM alpine:3.21.3 AS downloader - -ARG UID -ARG GID -ARG OIE_RELEASE_URL - -WORKDIR /opt - -# Download Open Integration Engine release -RUN apk add --no-cache curl \ - && curl -L \ - -o /opt/engine.tar.gz \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - ${OIE_RELEASE_URL}\ - && tar xzf engine.tar.gz \ - && mv /opt/oie /opt/engine \ - && mkdir -p /opt/engine/appdata - -WORKDIR /opt/engine -COPY --chmod=755 entrypoint.sh /opt/engine/entrypoint.sh - -RUN rm -rf cli-lib manager-lib \ - && rm mirth-cli-launcher.jar oiecommand - -RUN chown -R ${UID}:${GID} /opt/engine - - -########################################## -# Alpine based Images -########################################## -FROM eclipse-temurin:$BASE_IMAGE_TAG AS alpine - -ARG UID -ARG GID -ARG OIE_RELEASE_VERSION -ARG CREATED_AT - -# Add OCI best-practice labels https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys -LABEL "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ - "org.opencontainers.image.created"="${CREATED_AT?:}" \ - "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ - "org.opencontainers.image.licenses"="MPL-2.0" \ - "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ - "org.opencontainers.image.title"="Open Integration Engine" \ - "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ - "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ - "org.opencontainers.image.version"="${OIE_RELEASE_VERSION?:}" - -COPY --from=downloader /opt/engine /opt/engine - -RUN apk add --no-cache bash unzip \ - && adduser -D -H -u $UID engine engine - -VOLUME /opt/engine/appdata -VOLUME /opt/engine/custom-extensions - -WORKDIR /opt/engine -EXPOSE 8443 -USER engine - -ENTRYPOINT ["./entrypoint.sh"] -CMD ["./oieserver"] - -########################################## -# Ubuntu based Images -########################################## -FROM eclipse-temurin:$BASE_IMAGE_TAG AS ubuntu - -ARG UID -ARG GID -ARG OIE_RELEASE_VERSION -ARG CREATED_AT - -# Add OCI best-practice labels https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys -LABEL "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ - "org.opencontainers.image.created"="${CREATED_AT?:}" \ - "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ - "org.opencontainers.image.licenses"="MPL-2.0" \ - "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ - "org.opencontainers.image.title"="Open Integration Engine" \ - "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ - "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ - "org.opencontainers.image.version"="${OIE_RELEASE_VERSION?:}" - -COPY --from=downloader /opt/engine /opt/engine - -RUN apt-get update \ - && apt-get install -y unzip \ - && rm -rf /var/lib/apt/lists/* \ - && groupadd --gid ${GID} engine \ - && useradd -u ${UID} -g ${GID} -M engine - -VOLUME /opt/engine/appdata -VOLUME /opt/engine/custom-extensions - -WORKDIR /opt/engine -EXPOSE 8443 -USER engine - -ENTRYPOINT ["./entrypoint.sh"] -CMD ["./oieserver"] - diff --git a/deploy/compose.yaml b/deploy/compose.yaml deleted file mode 100644 index aa3e6f9..0000000 --- a/deploy/compose.yaml +++ /dev/null @@ -1,69 +0,0 @@ -name: open-integration-engine - -services: - ubuntu-jdk: - image: openintegrationengine/engine - build: - dockerfile: Dockerfile - target: ubuntu - context: . - args: - BASE_IMAGE_TAG: ${UBUNTU_JDK_TAG:?} - OIE_RELEASE_VERSION: ${OIE_RELEASE_VERSION:?} - OIE_RELEASE_URL: ${OIE_RELEASE_URL:?} - platforms: &platforms - - linux/amd64 -# - linux/arm64 - tags: - - openintegrationengine/engine:latest-ubuntu-jdk - - openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-ubuntu-jdk - - ubuntu-jre: - image: openintegrationengine/engine - build: - dockerfile: Dockerfile - target: ubuntu - context: . - args: - BASE_IMAGE_TAG: ${UBUNTU_JRE_TAG:?} - OIE_RELEASE_VERSION: ${OIE_RELEASE_VERSION:?} - OIE_RELEASE_URL: ${OIE_RELEASE_URL:?} - platforms: *platforms - tags: - - openintegrationengine/engine:latest-ubuntu - - openintegrationengine/engine:latest-ubuntu-jre - - openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-ubuntu - - openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-ubuntu-jre - - alpine-jdk: - image: openintegrationengine/engine - build: - dockerfile: Dockerfile - target: alpine - context: . - args: - BASE_IMAGE_TAG: ${ALPINE_JDK_TAG:?} - OIE_RELEASE_VERSION: ${OIE_RELEASE_VERSION:?} - OIE_RELEASE_URL: ${OIE_RELEASE_URL:?} - platforms: *platforms - tags: - - openintegrationengine/engine:latest-alpine-jdk - - openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-alpine-jre - - alpine-jre: - image: openintegrationengine/engine - build: - dockerfile: Dockerfile - target: alpine - context: . - args: - BASE_IMAGE_TAG: ${ALPINE_JRE_TAG:?} - OIE_RELEASE_VERSION: ${OIE_RELEASE_VERSION:?} - OIE_RELEASE_URL: ${OIE_RELEASE_URL:?} - platforms: *platforms - tags: - - openintegrationengine/engine:latest - - openintegrationengine/engine:latest-alpine - - openintegrationengine/engine:latest-alpine-jre - - openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-alpine - - openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-alpine-jre diff --git a/dockerfiles/4.5.2/Dockerfile b/dockerfiles/4.5.2/Dockerfile new file mode 100644 index 0000000..1b99a0d --- /dev/null +++ b/dockerfiles/4.5.2/Dockerfile @@ -0,0 +1,158 @@ +# syntax=docker/dockerfile:1 + +################################################################ +# # +# WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY # +# # +################################################################ + +ARG CREATED_AT + +FROM alpine:3.24.1 AS downloader + +WORKDIR /opt + +# Download Open Integration Engine release +RUN apk add --no-cache curl \ + && curl -L \ + -o /opt/engine.tar.gz \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://github.com/OpenIntegrationEngine/engine/releases/download/v4.5.2/oie_unix_4_5_2.tar.gz \ + && tar xzf engine.tar.gz \ + && mv /opt/oie /opt/engine \ + && mkdir -p /opt/engine/appdata + +WORKDIR /opt/engine +COPY --chmod=755 entrypoint.sh /opt/engine/entrypoint.sh + +RUN rm -rf cli-lib manager-lib \ + && rm mirth-cli-launcher.jar oiecommand + +FROM eclipse-temurin:17.0.20.1_1-jre-noble AS ubuntu-jre + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.5.2" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apt-get update \ + && apt-get install -y unzip \ + && rm -rf /var/lib/apt/lists/* \ + && groupmod --new-name engine ubuntu \ + && usermod -l engine ubuntu \ + && usermod -aG engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] + +FROM eclipse-temurin:17.0.20.1_1-jdk-noble AS ubuntu-jdk + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.5.2" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apt-get update \ + && apt-get install -y unzip \ + && rm -rf /var/lib/apt/lists/* \ + && groupmod --new-name engine ubuntu \ + && usermod -l engine ubuntu \ + && usermod -aG engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] + +FROM eclipse-temurin:17.0.20.1_1-jre-alpine AS alpine-jre + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.5.2" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apk add --no-cache bash unzip \ + && adduser -D -H -u 1000 engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] + +FROM eclipse-temurin:17.0.20.1_1-jdk-alpine AS alpine-jdk + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.5.2" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apk add --no-cache bash unzip \ + && adduser -D -H -u 1000 engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] diff --git a/dockerfiles/4.5.2/compose.yaml b/dockerfiles/4.5.2/compose.yaml new file mode 100644 index 0000000..0f3c536 --- /dev/null +++ b/dockerfiles/4.5.2/compose.yaml @@ -0,0 +1,61 @@ +################################################################ +# # +# WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY # +# # +################################################################ + +name: open-integration-engine + +services: + ubuntu-jre: + image: openintegrationengine/engine + build: + target: ubuntu-jre + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.5.2-ubuntu + - openintegrationengine/engine:4.5.2-ubuntu-jre + - openintegrationengine/engine:latest-ubuntu-jre + - openintegrationengine/engine:latest-ubuntu + + ubuntu-jdk: + image: openintegrationengine/engine + build: + target: ubuntu-jdk + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.5.2-ubuntu-jdk + - openintegrationengine/engine:latest-ubuntu-jdk + + alpine-jre: + image: openintegrationengine/engine + build: + target: alpine-jre + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.5.2-alpine + - openintegrationengine/engine:4.5.2-alpine-jre + - openintegrationengine/engine:latest-alpine-jre + - openintegrationengine/engine:latest-alpine + - openintegrationengine/engine:latest + + alpine-jdk: + image: openintegrationengine/engine + build: + target: alpine-jdk + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.5.2-alpine-jdk + - openintegrationengine/engine:latest-alpine-jdk diff --git a/deploy/entrypoint.sh b/dockerfiles/4.5.2/entrypoint.sh similarity index 100% rename from deploy/entrypoint.sh rename to dockerfiles/4.5.2/entrypoint.sh diff --git a/releases.yaml b/releases.yaml new file mode 100644 index 0000000..4af8e7b --- /dev/null +++ b/releases.yaml @@ -0,0 +1,40 @@ +# Specifies which slug should gain the "latest" tags +latest: 4.5.2 + +# Sets the alpine image tag for the downloader stage +downloaderTag: 3.24.1 + +# Owner of /opt/engine and the engine user. The Ubuntu images reuse the base image's "ubuntu" user, +# which is 1000:1000, so changing these values will not change the Ubuntu user. +uid: 1000 +gid: 1000 + +# Add OCI best-practice labels https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys +labels: |- + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="{{ .slug }}" + +versions: + - slug: 4.5.2 + releaseVersion: 4.5.2 + releaseUrl: https://github.com/OpenIntegrationEngine/engine/releases/download/v4.5.2/oie_unix_4_5_2.tar.gz + tags: + - distro: ubuntu + type: jre + tag: 17.0.20.1_1-jre-noble + - distro: ubuntu + type: jdk + tag: 17.0.20.1_1-jdk-noble + - distro: alpine + type: jre + tag: 17.0.20.1_1-jre-alpine + - distro: alpine + type: jdk + tag: 17.0.20.1_1-jdk-alpine diff --git a/render_docker_templates.sh b/render_docker_templates.sh new file mode 100755 index 0000000..6b2d2da --- /dev/null +++ b/render_docker_templates.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: MPL-2.0 +# + +set -e + +cd "$(dirname "$0")" + +# Start from an empty output directory so versions removed from releases.yaml are deleted +rm -rf dockerfiles + +# Render Dockerfiles +gomplate -V -c .=releases.yaml -f templates/Dockerfile.tpl + +# Render compose files +gomplate -V -c .=releases.yaml -f templates/compose.yaml.tpl + +# Copy the entrypoint script into each rendered version directory +for dir in dockerfiles/*/; do + cp -p templates/entrypoint.sh "$dir" +done diff --git a/templates/Dockerfile.tpl b/templates/Dockerfile.tpl new file mode 100644 index 0000000..c9cd82c --- /dev/null +++ b/templates/Dockerfile.tpl @@ -0,0 +1,82 @@ +{{/* Collect all root elements except "versions" into a variable */}} +{{- $config := coll.Omit "versions" . -}} + +{{/* Create gomplate specific iteration over versions array */}} +{{- range $version := .versions -}} + {{- $ctx := dict "config" $config "version" $version }} + + {{/* Define paths to render the Dockerfiles to */}} + {{- $outPath := printf "dockerfiles/%s/Dockerfile" $version.slug }} + + {{/* Render the inline template defined below */}} + {{- tmpl.Exec "dockerfile" $ctx | file.Write $outPath }} +{{- end -}} + +{{- define "dockerfile" -}} +# syntax=docker/dockerfile:1 + +################################################################ +# # +# WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY # +# # +################################################################ + +ARG CREATED_AT + +FROM alpine:{{ .config.downloaderTag }} AS downloader + +WORKDIR /opt + +# Download Open Integration Engine release +RUN apk add --no-cache curl \ + && curl -L \ + -o /opt/engine.tar.gz \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + {{ .version.releaseUrl }} \ + && tar xzf engine.tar.gz \ + && mv /opt/oie /opt/engine \ + && mkdir -p /opt/engine/appdata + +WORKDIR /opt/engine +COPY --chmod=755 entrypoint.sh /opt/engine/entrypoint.sh + +RUN rm -rf cli-lib manager-lib \ + && rm mirth-cli-launcher.jar oiecommand +{{/* Assign current version slug into a variable to carry it into the tags iteration */}} +{{- $slug := dict "slug" .version.slug -}} +{{/* Iterate version tags to generate the final stages */}} +{{- range .version.tags }} +FROM eclipse-temurin:{{ .tag }} AS {{ print .distro "-" .type }} + +ARG CREATED_AT + +LABEL \ +{{/* Render the Labels section to include the slug */}} +{{- tpl $.config.labels $slug | strings.Indent 2 }} + +COPY --from=downloader --chown={{ $.config.uid }}:{{ $.config.gid }} /opt/engine /opt/engine +{{ if eq .distro "ubuntu" }} +RUN apt-get update \ + && apt-get install -y unzip \ + && rm -rf /var/lib/apt/lists/* \ + && groupmod --new-name engine ubuntu \ + && usermod -l engine ubuntu \ + && usermod -aG engine engine +{{- else if eq .distro "alpine" }} +RUN apk add --no-cache bash unzip \ + && adduser -D -H -u {{ $.config.uid }} engine engine +{{- end }} + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] +{{ end -}} + +{{ end }} diff --git a/templates/compose.yaml.tpl b/templates/compose.yaml.tpl new file mode 100644 index 0000000..8cc89a5 --- /dev/null +++ b/templates/compose.yaml.tpl @@ -0,0 +1,50 @@ +{{/* Create gomplate specific iteration over versions array */}} +{{- range $version := .versions -}} + {{- $ctx := dict "latest" $.latest "version" $version }} + + {{/* Define paths to render the Dockerfiles to */}} + {{- $outPath := printf "dockerfiles/%s/compose.yaml" $version.slug }} + + {{/* Render the inline template defined below */}} + {{- tmpl.Exec "composefile" $ctx | file.Write $outPath }} +{{- end -}} + +{{- define "composefile" -}} +################################################################ +# # +# WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY # +# # +################################################################ + +name: open-integration-engine + +{{/* Assign current version slug into a variable to carry it into the tags iteration */}} +{{- $slug := .version.slug -}} +services: +{{- range $i, $tag := .version.tags }} +{{- if $i }} +{{ end }} + {{ .distro }}-{{ .type }}: + image: openintegrationengine/engine + build: + target: {{ .distro }}-{{ .type }} + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + {{- if eq .type "jre" }} + - openintegrationengine/engine:{{ $slug }}-{{ .distro }} + {{- end }} + - openintegrationengine/engine:{{ $slug }}-{{ .distro }}-{{ .type }} + {{- if eq $slug $.latest }} + - openintegrationengine/engine:latest-{{ .distro }}-{{ .type }} + {{- if eq .type "jre" }} + - openintegrationengine/engine:latest-{{ .distro }} + {{- if eq .distro "alpine" }} + - openintegrationengine/engine:latest + {{- end }} + {{- end }} + {{- end }} +{{- end }} +{{ end }} diff --git a/templates/entrypoint.sh b/templates/entrypoint.sh new file mode 100755 index 0000000..285d501 --- /dev/null +++ b/templates/entrypoint.sh @@ -0,0 +1,245 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2023 NextGen Healthcare +# SPDX-FileCopyrightText: 2025 Kaur Palang +# + +set -e + +APP_DIR=/opt/engine + +custom_extension_count=`ls -1 "$APP_DIR"/custom-extensions/*.zip 2>/dev/null | wc -l` +if [ $custom_extension_count != 0 ]; then + echo "Found ${custom_extension_count} custom extensions." + for extension in $(ls -1 "$APP_DIR"/custom-extensions/*.zip); do + unzip -o -q $extension -d "$APP_DIR/extensions" + done +fi + +# set storepass and keypass to 'changeme' so they aren't overwritten later +KEYSTORE_PASS=changeme +sed -i "s/^keystore\.storepass\s*=\s*.*\$/keystore.storepass = ${KEYSTORE_PASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +sed -i "s/^keystore\.keypass\s*=\s*.*\$/keystore.keypass = ${KEYSTORE_PASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" + +# merge the environment variables into /opt/engine/conf/mirth.properties +# db type +if ! [ -z "${DATABASE+x}" ]; then + sed -i "s/^database\s*=\s*.*\$/database = ${DATABASE//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# db username +if ! [ -z "${DATABASE_USERNAME+x}" ]; then + sed -i "s/^database\.username\s*=\s*.*\$/database.username = ${DATABASE_USERNAME//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# db password +if ! [ -z "${DATABASE_PASSWORD+x}" ]; then + sed -i "s/^database\.password\s*=\s*.*\$/database.password = ${DATABASE_PASSWORD//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# db url +if ! [ -z "${DATABASE_URL+x}" ]; then + sed -i "s/^database\.url\s*=\s*.*\$/database.url = ${DATABASE_URL//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# database max connections +if ! [ -z "${DATABASE_MAX_CONNECTIONS+x}" ]; then + sed -i "s/^database\.max-connections\s*=\s*.*\$/database.max-connections = ${DATABASE_MAX_CONNECTIONS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# database max retries +if ! [ -z "${DATABASE_MAX_RETRY+x}" ]; then + sed -i "s/^database\.connection\.maxretry\s*=\s*.*\$/database.connection.maxretry = ${DATABASE_MAX_RETRY//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# database retry wait time +if ! [ -z "${DATABASE_RETRY_WAIT+x}" ]; then + sed -i "s/^database\.connection\.retrywaitinmilliseconds\s*=\s*.*\$/database.connection.retrywaitinmilliseconds = ${DATABASE_RETRY_WAIT//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# keystore storepass +if ! [ -z "${KEYSTORE_STOREPASS+x}" ]; then + sed -i "s/^keystore\.storepass\s*=\s*.*\$/keystore.storepass = ${KEYSTORE_STOREPASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# keystore keypass +if ! [ -z "${KEYSTORE_KEYPASS+x}" ]; then + sed -i "s/^keystore\.keypass\s*=\s*.*\$/keystore.keypass = ${KEYSTORE_KEYPASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +if ! [ -z "${KEYSTORE_TYPE+x}" ]; then + sed -i "s/^keystore\.type\s*=\s*.*\$/keystore.type = ${KEYSTORE_TYPE//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# session store +if ! [ -z "${SESSION_STORE+x}" ]; then + LINE_COUNT=`grep "server.api.sessionstore" "$APP_DIR/conf/mirth.properties" | wc -l` + if [ $LINE_COUNT -lt 1 ]; then + echo -e "\nserver.api.sessionstore = ${SESSION_STORE//\//\\/}" >> "$APP_DIR/conf/mirth.properties" + else + sed -i "s/^server\.api\.sessionstore\s*=\s*.*\$/server.api.sessionstore = ${SESSION_STORE//\//\\/}/" "$APP_DIR/conf/mirth.properties" + fi +fi + +#server ID +if ! [ -z "${SERVER_ID+x}" ]; then + echo -e "server.id = ${SERVER_ID//\//\\/}" > "$APP_DIR/appdata/server.id" +fi + +# merge extra environment variables starting with _MP_ into mirth.properties +while read -r keyvalue; do + KEY="${keyvalue%%=*}" + VALUE="${keyvalue#*=}" + VALUE=$(tr -dc '\40-\176' <<< "$VALUE") + + if ! [ -z "${KEY}" ] && ! [ -z "${VALUE}" ] && ! [[ ${VALUE} =~ ^\ +$ ]]; then + + # filter for variables starting with "_MP_" + if [[ ${KEY} == _MP_* ]]; then + + # echo "found property ${KEY}=${VALUE}" + + # example: _MP_DATABASE_MAX__CONNECTIONS -> database.max-connections + + # remove _MP_ + # example: DATABASE_MAX__CONNECTIONS + ACTUAL_KEY=${KEY:4} + + # switch '__' to '-' + # example: DATABASE_MAX-CONNECTIONS + ACTUAL_KEY="${ACTUAL_KEY//__/-}" + + # switch '_' to '.' + # example: DATABASE.MAX-CONNECTIONS + ACTUAL_KEY="${ACTUAL_KEY//_/.}" + + # lower case + # example: database.max-connections + ACTUAL_KEY="${ACTUAL_KEY,,}" + + # if key does not exist in mirth.properties append it at bottom + LINE_COUNT=`grep "^${ACTUAL_KEY}" "$APP_DIR/conf/mirth.properties" | wc -l` + if [ $LINE_COUNT -lt 1 ]; then + # echo "key ${ACTUAL_KEY} not found in mirth.properties, appending. Value = ${VALUE}" + echo -e "\n${ACTUAL_KEY} = ${VALUE//\//\\/}" >> "$APP_DIR/conf/mirth.properties" + else # otherwise key exists, overwrite it + # echo "key ${ACTUAL_KEY} exists, overwriting. Value = ${VALUE}" + ESCAPED_KEY="${ACTUAL_KEY//./\\.}" + sed -i "s/^${ESCAPED_KEY}\s*=\s*.*\$/${ACTUAL_KEY} = ${VALUE//\//\\/}/" "$APP_DIR/conf/mirth.properties" + fi + fi + fi +done <<< "`printenv`" + +# merge vmoptions into /opt/engine/oieserver.vmoptions +if ! [ -z "${VMOPTIONS+x}" ]; then + PREV_IFS="$IFS" + IFS="," + read -ra vmoptions <<< "$VMOPTIONS" + IFS="$PREV_IFS" + + for vmoption in "${vmoptions[@]}" + do + echo "${vmoption}" >> "$APP_DIR/oieserver.vmoptions" + done +fi + +# merge the user's secret mirth.properties +# takes a whole mirth.properties file and merges line by line with /opt/engine/conf/mirth.properties +if [ -f /run/secrets/mirth_properties ]; then + + # add new line in case /opt/engine/conf/mirth.properties doesn't end with one + echo "" >> "$APP_DIR/conf/mirth.properties" + + while read -r keyvalue; do + KEY="${keyvalue%%=*}" + VALUE="${keyvalue#*=}" + + # remove leading and trailing white space + KEY="$(echo -e "${KEY}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + VALUE="$(echo -e "${VALUE}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + + if ! [ -z "${KEY}" ] && ! [ -z "${VALUE}" ] && ! [[ ${VALUE} =~ ^\ +$ ]]; then + # if key does not exist in mirth.properties append it at bottom + LINE_COUNT=`grep "^${KEY}" "$APP_DIR/conf/mirth.properties" | wc -l` + if [ $LINE_COUNT -lt 1 ]; then + # echo "key ${KEY} not found in mirth.properties, appending. Value = ${VALUE}" + echo -e "${KEY} = ${VALUE//\//\\/}" >> "$APP_DIR/conf/mirth.properties" + else # otherwise key exists, overwrite it + # echo "key ${KEY} exists, overwriting. Value = ${VALUE}" + ESCAPED_KEY="${KEY//./\\.}" + sed -i "s/^${ESCAPED_KEY}\s*=\s*.*\$/${KEY} = ${VALUE//\//\\/}/" "$APP_DIR/conf/mirth.properties" + fi + fi + done <<< "`cat /run/secrets/mirth_properties`" +fi + +# merge the user's secret vmoptions +# takes a whole oieserver.vmoptions file and merges line by line with /opt/engine/oieserver.vmoptions +if [ -f /run/secrets/oieserver_vmoptions ]; then + (cat /run/secrets/oieserver_vmoptions ; echo "") >> "$APP_DIR/oieserver.vmoptions" +fi + +# download jars from this url "$CUSTOM_JARS_DOWNLOAD", set by user +if ! [ -z "${CUSTOM_JARS_DOWNLOAD+x}" ]; then + echo "Downloading Jars at ${CUSTOM_JARS_DOWNLOAD}" + if ! [ -z "${ALLOW_INSECURE}" ] && [ "${ALLOW_INSECURE}" == "true" ]; then + curl -ksSLf "${CUSTOM_JARS_DOWNLOAD}" -o userJars.zip || echo "problem with custom jars download" + else + curl -sSLf "${CUSTOM_JARS_DOWNLOAD}" -o userJars.zip || echo "problem with custom jars download" + fi + + # Unzipping contents of userJars.zip into /opt/engine/server-launcher-lib folder + if [ -e "userJars.zip" ]; then + echo "Unzipping contents of userJars.zip into $APP_DIR/server-launcher-lib" + unzip userJars.zip -d "$APP_DIR/server-launcher-lib" + # removing the downloaded zip file + rm userJars.zip + fi +fi + +# download extensions from this url "$EXTENSIONS_DOWNLOAD", set by user +if ! [ -z "${EXTENSIONS_DOWNLOAD+x}" ]; then + echo "Downloading extensions at ${EXTENSIONS_DOWNLOAD}" + if ! [ -z "${ALLOW_INSECURE}" ] && [ "${ALLOW_INSECURE}" == "true" ]; then + curl -ksSLf "${EXTENSIONS_DOWNLOAD}" -o userExtensions.zip || echo "problem with extensions download" + else + curl -sSLf "${EXTENSIONS_DOWNLOAD}" -o userExtensions.zip || echo "problem with extensions download" + fi + + # Unzipping contents of userExtensions.zip + if [ -e "userExtensions.zip" ]; then + echo "Unzipping contents of userExtensions.zip" + mkdir /tmp/userextensions + unzip userExtensions.zip -d /tmp/userextensions + # removing the downloaded zip file + rm userExtensions.zip + + # Unzipping contents of individual extension zip files into /opt/engine/extensions folder + zipFileCount=`ls -1 /tmp/userextensions/*.zip 2>/dev/null | wc -l` + if [ $zipFileCount != 0 ]; then + echo "Unzipping contents of /tmp/userextensions/ zips into $APP_DIR/extensions" + for f in /tmp/userextensions/*.zip; do unzip "$f" -d "$APP_DIR/extensions"; done + fi + # removing the tmp folder + rm -rf /tmp/userextensions + fi +fi + +# download keystore +if ! [ -z "${KEYSTORE_DOWNLOAD+x}" ]; then + echo "Downloading keystore at ${KEYSTORE_DOWNLOAD}" + if ! [ -z "${ALLOW_INSECURE}" ] && [ "${ALLOW_INSECURE}" == "true" ]; then + curl -ksSLf "${KEYSTORE_DOWNLOAD}" -o "$APP_DIR/appdata/keystore.jks" || echo "problem with keystore download" + else + curl -sSLf "${KEYSTORE_DOWNLOAD}" -o "$APP_DIR/appdata/keystore.jks" || echo "problem with keystore download" + fi +fi + +# if delay is set as an environment variable then wait that long in seconds +if ! [ -z "${DELAY+x}" ]; then + sleep $DELAY +fi + +exec "$@" From d9e101dd87bd855db1573b6552cfe1abf9f795ba Mon Sep 17 00:00:00 2001 From: Kaur Palang Date: Tue, 6 Oct 2026 16:02:19 -0400 Subject: [PATCH 2/5] Add 4.6.0 images and make them latest Add 4.6.0 to releases.yaml and the build matrix, render dockerfiles/4.6.0/, and move the latest tags from 4.5.2 to 4.6.0. The README now lists the image tags for each version and the floating tags. 4.6.0 images use the eclipse-temurin 21.0.11_10 base images (Ubuntu resolute and Alpine). Adapted from BrightCodeCompany/engine-docker@450d8c0 (MPL-2.0). Source commits: 5ddaea8 4060f30 bf60b44 450d8c0 c6bfcd7 Modifications from the BCC version: - releases.yaml: no 4.6.0-rc1 entry. - .github/workflows/build-and-deploy-images.yaml: matrix is 4.5.2 and 4.6.0 (BCC also builds 4.6.0-rc1). - README.md: "Supported Images" section taken from BCC without the 4.6.0-rc1 entry. Each version's JRE tags also list the - alias (not in BCC). - dockerfiles/4.6.0/*: rendered output. Same as BCC's except for the OCI authors/vendor/source labels, the image repository (openintegrationengine/engine instead of brightcodecompany/openintegrationengine), and the template changes listed in the previous commit (JRE-only - tag and whitespace). Signed-off-by: Kaur Palang Co-authored-by: Tony Germano Signed-off-by: Tony Germano --- .../workflows/build-and-deploy-images.yaml | 1 + README.md | 33 ++- dockerfiles/4.5.2/compose.yaml | 7 - dockerfiles/4.6.0/Dockerfile | 158 +++++++++++ dockerfiles/4.6.0/compose.yaml | 61 +++++ dockerfiles/4.6.0/entrypoint.sh | 245 ++++++++++++++++++ releases.yaml | 19 +- 7 files changed, 506 insertions(+), 18 deletions(-) create mode 100644 dockerfiles/4.6.0/Dockerfile create mode 100644 dockerfiles/4.6.0/compose.yaml create mode 100755 dockerfiles/4.6.0/entrypoint.sh diff --git a/.github/workflows/build-and-deploy-images.yaml b/.github/workflows/build-and-deploy-images.yaml index e5c1f18..bad392c 100644 --- a/.github/workflows/build-and-deploy-images.yaml +++ b/.github/workflows/build-and-deploy-images.yaml @@ -19,6 +19,7 @@ jobs: matrix: oie_version: - 4.5.2 + - 4.6.0 steps: - name: Checkout uses: actions/checkout@v6 diff --git a/README.md b/README.md index d7691ca..e4ea478 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,29 @@ for building, deploying, and managing interfaces, along with powerful features f # Supported Images [↑](#top) -All Open Integration Engine releases are packaged into the four following images: - -- `latest`, `latest-alpine`, `latest-alpine-jre` - - `4.5.2-tp.1-alpine`, `4.5.2-tp.1-alpine-jre` -- `latest-alpine-jdk` - - `4.5.2-tp.1-alpine-jdk` -- `latest-ubuntu`, `latest-ubuntu-jre` - - `4.5.2-tp.1-ubuntu`, `4.5.2-tp.1-ubuntu-jre` -- `latest-ubuntu-jdk` - - `4.5.2-tp.1-ubuntu-jdk` +All Open Integration Engine releases are packaged into the following images: + +### Version 4.6.0 _(latest)_ +- **Alpine**: `4.6.0-alpine-jre` (also `4.6.0-alpine`), `4.6.0-alpine-jdk` +- **Ubuntu**: `4.6.0-ubuntu-jre` (also `4.6.0-ubuntu`), `4.6.0-ubuntu-jdk` + +### Version 4.5.2 +- **Alpine**: `4.5.2-alpine-jre` (also `4.5.2-alpine`), `4.5.2-alpine-jdk` +- **Ubuntu**: `4.5.2-ubuntu-jre` (also `4.5.2-ubuntu`), `4.5.2-ubuntu-jdk` + +--- +### Floating Tags + +- **Default**: + - `latest` → `4.6.0-alpine-jre` +- **Distro Only**: + - `latest-alpine` → `4.6.0-alpine-jre` + - `latest-ubuntu` → `4.6.0-ubuntu-jre` +- **Distro + JVM**: + - `latest-alpine-jre` → `4.6.0-alpine-jre` + - `latest-alpine-jdk` → `4.6.0-alpine-jdk` + - `latest-ubuntu-jre` → `4.6.0-ubuntu-jre` + - `latest-ubuntu-jdk` → `4.6.0-ubuntu-jdk` ------------ diff --git a/dockerfiles/4.5.2/compose.yaml b/dockerfiles/4.5.2/compose.yaml index 0f3c536..d4280c5 100644 --- a/dockerfiles/4.5.2/compose.yaml +++ b/dockerfiles/4.5.2/compose.yaml @@ -18,8 +18,6 @@ services: tags: - openintegrationengine/engine:4.5.2-ubuntu - openintegrationengine/engine:4.5.2-ubuntu-jre - - openintegrationengine/engine:latest-ubuntu-jre - - openintegrationengine/engine:latest-ubuntu ubuntu-jdk: image: openintegrationengine/engine @@ -31,7 +29,6 @@ services: - linux/arm64 tags: - openintegrationengine/engine:4.5.2-ubuntu-jdk - - openintegrationengine/engine:latest-ubuntu-jdk alpine-jre: image: openintegrationengine/engine @@ -44,9 +41,6 @@ services: tags: - openintegrationengine/engine:4.5.2-alpine - openintegrationengine/engine:4.5.2-alpine-jre - - openintegrationengine/engine:latest-alpine-jre - - openintegrationengine/engine:latest-alpine - - openintegrationengine/engine:latest alpine-jdk: image: openintegrationengine/engine @@ -58,4 +52,3 @@ services: - linux/arm64 tags: - openintegrationengine/engine:4.5.2-alpine-jdk - - openintegrationengine/engine:latest-alpine-jdk diff --git a/dockerfiles/4.6.0/Dockerfile b/dockerfiles/4.6.0/Dockerfile new file mode 100644 index 0000000..8649974 --- /dev/null +++ b/dockerfiles/4.6.0/Dockerfile @@ -0,0 +1,158 @@ +# syntax=docker/dockerfile:1 + +################################################################ +# # +# WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY # +# # +################################################################ + +ARG CREATED_AT + +FROM alpine:3.24.1 AS downloader + +WORKDIR /opt + +# Download Open Integration Engine release +RUN apk add --no-cache curl \ + && curl -L \ + -o /opt/engine.tar.gz \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://github.com/OpenIntegrationEngine/engine/releases/download/v4.6.0/oie_unix_4_6_0.tar.gz \ + && tar xzf engine.tar.gz \ + && mv /opt/oie /opt/engine \ + && mkdir -p /opt/engine/appdata + +WORKDIR /opt/engine +COPY --chmod=755 entrypoint.sh /opt/engine/entrypoint.sh + +RUN rm -rf cli-lib manager-lib \ + && rm mirth-cli-launcher.jar oiecommand + +FROM eclipse-temurin:21.0.11_10-jre-resolute AS ubuntu-jre + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.6.0" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apt-get update \ + && apt-get install -y unzip \ + && rm -rf /var/lib/apt/lists/* \ + && groupmod --new-name engine ubuntu \ + && usermod -l engine ubuntu \ + && usermod -aG engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] + +FROM eclipse-temurin:21.0.11_10-jdk-resolute AS ubuntu-jdk + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.6.0" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apt-get update \ + && apt-get install -y unzip \ + && rm -rf /var/lib/apt/lists/* \ + && groupmod --new-name engine ubuntu \ + && usermod -l engine ubuntu \ + && usermod -aG engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] + +FROM eclipse-temurin:21.0.11_10-jre-alpine AS alpine-jre + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.6.0" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apk add --no-cache bash unzip \ + && adduser -D -H -u 1000 engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] + +FROM eclipse-temurin:21.0.11_10-jdk-alpine AS alpine-jdk + +ARG CREATED_AT + +LABEL \ + "org.opencontainers.image.authors"="The Open Integration Engine Project and contributors" \ + "org.opencontainers.image.created"="${CREATED_AT?:}" \ + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ + "org.opencontainers.image.licenses"="MPL-2.0" \ + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ + "org.opencontainers.image.title"="Open Integration Engine" \ + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ + "org.opencontainers.image.vendor"="The Open Integration Engine Project" \ + "org.opencontainers.image.version"="4.6.0" + +COPY --from=downloader --chown=1000:1000 /opt/engine /opt/engine + +RUN apk add --no-cache bash unzip \ + && adduser -D -H -u 1000 engine engine + +VOLUME /opt/engine/appdata +VOLUME /opt/engine/custom-extensions + +WORKDIR /opt/engine +EXPOSE 8443 +USER engine + +ENTRYPOINT ["./entrypoint.sh"] +CMD ["./oieserver"] diff --git a/dockerfiles/4.6.0/compose.yaml b/dockerfiles/4.6.0/compose.yaml new file mode 100644 index 0000000..b910bd8 --- /dev/null +++ b/dockerfiles/4.6.0/compose.yaml @@ -0,0 +1,61 @@ +################################################################ +# # +# WARNING: THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY # +# # +################################################################ + +name: open-integration-engine + +services: + ubuntu-jre: + image: openintegrationengine/engine + build: + target: ubuntu-jre + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.6.0-ubuntu + - openintegrationengine/engine:4.6.0-ubuntu-jre + - openintegrationengine/engine:latest-ubuntu-jre + - openintegrationengine/engine:latest-ubuntu + + ubuntu-jdk: + image: openintegrationengine/engine + build: + target: ubuntu-jdk + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.6.0-ubuntu-jdk + - openintegrationengine/engine:latest-ubuntu-jdk + + alpine-jre: + image: openintegrationengine/engine + build: + target: alpine-jre + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.6.0-alpine + - openintegrationengine/engine:4.6.0-alpine-jre + - openintegrationengine/engine:latest-alpine-jre + - openintegrationengine/engine:latest-alpine + - openintegrationengine/engine:latest + + alpine-jdk: + image: openintegrationengine/engine + build: + target: alpine-jdk + context: . + platforms: + - linux/amd64 + - linux/arm64 + tags: + - openintegrationengine/engine:4.6.0-alpine-jdk + - openintegrationengine/engine:latest-alpine-jdk diff --git a/dockerfiles/4.6.0/entrypoint.sh b/dockerfiles/4.6.0/entrypoint.sh new file mode 100755 index 0000000..285d501 --- /dev/null +++ b/dockerfiles/4.6.0/entrypoint.sh @@ -0,0 +1,245 @@ +#!/usr/bin/env bash +# +# SPDX-License-Identifier: MPL-2.0 +# SPDX-FileCopyrightText: 2023 NextGen Healthcare +# SPDX-FileCopyrightText: 2025 Kaur Palang +# + +set -e + +APP_DIR=/opt/engine + +custom_extension_count=`ls -1 "$APP_DIR"/custom-extensions/*.zip 2>/dev/null | wc -l` +if [ $custom_extension_count != 0 ]; then + echo "Found ${custom_extension_count} custom extensions." + for extension in $(ls -1 "$APP_DIR"/custom-extensions/*.zip); do + unzip -o -q $extension -d "$APP_DIR/extensions" + done +fi + +# set storepass and keypass to 'changeme' so they aren't overwritten later +KEYSTORE_PASS=changeme +sed -i "s/^keystore\.storepass\s*=\s*.*\$/keystore.storepass = ${KEYSTORE_PASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +sed -i "s/^keystore\.keypass\s*=\s*.*\$/keystore.keypass = ${KEYSTORE_PASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" + +# merge the environment variables into /opt/engine/conf/mirth.properties +# db type +if ! [ -z "${DATABASE+x}" ]; then + sed -i "s/^database\s*=\s*.*\$/database = ${DATABASE//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# db username +if ! [ -z "${DATABASE_USERNAME+x}" ]; then + sed -i "s/^database\.username\s*=\s*.*\$/database.username = ${DATABASE_USERNAME//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# db password +if ! [ -z "${DATABASE_PASSWORD+x}" ]; then + sed -i "s/^database\.password\s*=\s*.*\$/database.password = ${DATABASE_PASSWORD//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# db url +if ! [ -z "${DATABASE_URL+x}" ]; then + sed -i "s/^database\.url\s*=\s*.*\$/database.url = ${DATABASE_URL//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# database max connections +if ! [ -z "${DATABASE_MAX_CONNECTIONS+x}" ]; then + sed -i "s/^database\.max-connections\s*=\s*.*\$/database.max-connections = ${DATABASE_MAX_CONNECTIONS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# database max retries +if ! [ -z "${DATABASE_MAX_RETRY+x}" ]; then + sed -i "s/^database\.connection\.maxretry\s*=\s*.*\$/database.connection.maxretry = ${DATABASE_MAX_RETRY//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# database retry wait time +if ! [ -z "${DATABASE_RETRY_WAIT+x}" ]; then + sed -i "s/^database\.connection\.retrywaitinmilliseconds\s*=\s*.*\$/database.connection.retrywaitinmilliseconds = ${DATABASE_RETRY_WAIT//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# keystore storepass +if ! [ -z "${KEYSTORE_STOREPASS+x}" ]; then + sed -i "s/^keystore\.storepass\s*=\s*.*\$/keystore.storepass = ${KEYSTORE_STOREPASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# keystore keypass +if ! [ -z "${KEYSTORE_KEYPASS+x}" ]; then + sed -i "s/^keystore\.keypass\s*=\s*.*\$/keystore.keypass = ${KEYSTORE_KEYPASS//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +if ! [ -z "${KEYSTORE_TYPE+x}" ]; then + sed -i "s/^keystore\.type\s*=\s*.*\$/keystore.type = ${KEYSTORE_TYPE//\//\\/}/" "$APP_DIR/conf/mirth.properties" +fi + +# session store +if ! [ -z "${SESSION_STORE+x}" ]; then + LINE_COUNT=`grep "server.api.sessionstore" "$APP_DIR/conf/mirth.properties" | wc -l` + if [ $LINE_COUNT -lt 1 ]; then + echo -e "\nserver.api.sessionstore = ${SESSION_STORE//\//\\/}" >> "$APP_DIR/conf/mirth.properties" + else + sed -i "s/^server\.api\.sessionstore\s*=\s*.*\$/server.api.sessionstore = ${SESSION_STORE//\//\\/}/" "$APP_DIR/conf/mirth.properties" + fi +fi + +#server ID +if ! [ -z "${SERVER_ID+x}" ]; then + echo -e "server.id = ${SERVER_ID//\//\\/}" > "$APP_DIR/appdata/server.id" +fi + +# merge extra environment variables starting with _MP_ into mirth.properties +while read -r keyvalue; do + KEY="${keyvalue%%=*}" + VALUE="${keyvalue#*=}" + VALUE=$(tr -dc '\40-\176' <<< "$VALUE") + + if ! [ -z "${KEY}" ] && ! [ -z "${VALUE}" ] && ! [[ ${VALUE} =~ ^\ +$ ]]; then + + # filter for variables starting with "_MP_" + if [[ ${KEY} == _MP_* ]]; then + + # echo "found property ${KEY}=${VALUE}" + + # example: _MP_DATABASE_MAX__CONNECTIONS -> database.max-connections + + # remove _MP_ + # example: DATABASE_MAX__CONNECTIONS + ACTUAL_KEY=${KEY:4} + + # switch '__' to '-' + # example: DATABASE_MAX-CONNECTIONS + ACTUAL_KEY="${ACTUAL_KEY//__/-}" + + # switch '_' to '.' + # example: DATABASE.MAX-CONNECTIONS + ACTUAL_KEY="${ACTUAL_KEY//_/.}" + + # lower case + # example: database.max-connections + ACTUAL_KEY="${ACTUAL_KEY,,}" + + # if key does not exist in mirth.properties append it at bottom + LINE_COUNT=`grep "^${ACTUAL_KEY}" "$APP_DIR/conf/mirth.properties" | wc -l` + if [ $LINE_COUNT -lt 1 ]; then + # echo "key ${ACTUAL_KEY} not found in mirth.properties, appending. Value = ${VALUE}" + echo -e "\n${ACTUAL_KEY} = ${VALUE//\//\\/}" >> "$APP_DIR/conf/mirth.properties" + else # otherwise key exists, overwrite it + # echo "key ${ACTUAL_KEY} exists, overwriting. Value = ${VALUE}" + ESCAPED_KEY="${ACTUAL_KEY//./\\.}" + sed -i "s/^${ESCAPED_KEY}\s*=\s*.*\$/${ACTUAL_KEY} = ${VALUE//\//\\/}/" "$APP_DIR/conf/mirth.properties" + fi + fi + fi +done <<< "`printenv`" + +# merge vmoptions into /opt/engine/oieserver.vmoptions +if ! [ -z "${VMOPTIONS+x}" ]; then + PREV_IFS="$IFS" + IFS="," + read -ra vmoptions <<< "$VMOPTIONS" + IFS="$PREV_IFS" + + for vmoption in "${vmoptions[@]}" + do + echo "${vmoption}" >> "$APP_DIR/oieserver.vmoptions" + done +fi + +# merge the user's secret mirth.properties +# takes a whole mirth.properties file and merges line by line with /opt/engine/conf/mirth.properties +if [ -f /run/secrets/mirth_properties ]; then + + # add new line in case /opt/engine/conf/mirth.properties doesn't end with one + echo "" >> "$APP_DIR/conf/mirth.properties" + + while read -r keyvalue; do + KEY="${keyvalue%%=*}" + VALUE="${keyvalue#*=}" + + # remove leading and trailing white space + KEY="$(echo -e "${KEY}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + VALUE="$(echo -e "${VALUE}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + + if ! [ -z "${KEY}" ] && ! [ -z "${VALUE}" ] && ! [[ ${VALUE} =~ ^\ +$ ]]; then + # if key does not exist in mirth.properties append it at bottom + LINE_COUNT=`grep "^${KEY}" "$APP_DIR/conf/mirth.properties" | wc -l` + if [ $LINE_COUNT -lt 1 ]; then + # echo "key ${KEY} not found in mirth.properties, appending. Value = ${VALUE}" + echo -e "${KEY} = ${VALUE//\//\\/}" >> "$APP_DIR/conf/mirth.properties" + else # otherwise key exists, overwrite it + # echo "key ${KEY} exists, overwriting. Value = ${VALUE}" + ESCAPED_KEY="${KEY//./\\.}" + sed -i "s/^${ESCAPED_KEY}\s*=\s*.*\$/${KEY} = ${VALUE//\//\\/}/" "$APP_DIR/conf/mirth.properties" + fi + fi + done <<< "`cat /run/secrets/mirth_properties`" +fi + +# merge the user's secret vmoptions +# takes a whole oieserver.vmoptions file and merges line by line with /opt/engine/oieserver.vmoptions +if [ -f /run/secrets/oieserver_vmoptions ]; then + (cat /run/secrets/oieserver_vmoptions ; echo "") >> "$APP_DIR/oieserver.vmoptions" +fi + +# download jars from this url "$CUSTOM_JARS_DOWNLOAD", set by user +if ! [ -z "${CUSTOM_JARS_DOWNLOAD+x}" ]; then + echo "Downloading Jars at ${CUSTOM_JARS_DOWNLOAD}" + if ! [ -z "${ALLOW_INSECURE}" ] && [ "${ALLOW_INSECURE}" == "true" ]; then + curl -ksSLf "${CUSTOM_JARS_DOWNLOAD}" -o userJars.zip || echo "problem with custom jars download" + else + curl -sSLf "${CUSTOM_JARS_DOWNLOAD}" -o userJars.zip || echo "problem with custom jars download" + fi + + # Unzipping contents of userJars.zip into /opt/engine/server-launcher-lib folder + if [ -e "userJars.zip" ]; then + echo "Unzipping contents of userJars.zip into $APP_DIR/server-launcher-lib" + unzip userJars.zip -d "$APP_DIR/server-launcher-lib" + # removing the downloaded zip file + rm userJars.zip + fi +fi + +# download extensions from this url "$EXTENSIONS_DOWNLOAD", set by user +if ! [ -z "${EXTENSIONS_DOWNLOAD+x}" ]; then + echo "Downloading extensions at ${EXTENSIONS_DOWNLOAD}" + if ! [ -z "${ALLOW_INSECURE}" ] && [ "${ALLOW_INSECURE}" == "true" ]; then + curl -ksSLf "${EXTENSIONS_DOWNLOAD}" -o userExtensions.zip || echo "problem with extensions download" + else + curl -sSLf "${EXTENSIONS_DOWNLOAD}" -o userExtensions.zip || echo "problem with extensions download" + fi + + # Unzipping contents of userExtensions.zip + if [ -e "userExtensions.zip" ]; then + echo "Unzipping contents of userExtensions.zip" + mkdir /tmp/userextensions + unzip userExtensions.zip -d /tmp/userextensions + # removing the downloaded zip file + rm userExtensions.zip + + # Unzipping contents of individual extension zip files into /opt/engine/extensions folder + zipFileCount=`ls -1 /tmp/userextensions/*.zip 2>/dev/null | wc -l` + if [ $zipFileCount != 0 ]; then + echo "Unzipping contents of /tmp/userextensions/ zips into $APP_DIR/extensions" + for f in /tmp/userextensions/*.zip; do unzip "$f" -d "$APP_DIR/extensions"; done + fi + # removing the tmp folder + rm -rf /tmp/userextensions + fi +fi + +# download keystore +if ! [ -z "${KEYSTORE_DOWNLOAD+x}" ]; then + echo "Downloading keystore at ${KEYSTORE_DOWNLOAD}" + if ! [ -z "${ALLOW_INSECURE}" ] && [ "${ALLOW_INSECURE}" == "true" ]; then + curl -ksSLf "${KEYSTORE_DOWNLOAD}" -o "$APP_DIR/appdata/keystore.jks" || echo "problem with keystore download" + else + curl -sSLf "${KEYSTORE_DOWNLOAD}" -o "$APP_DIR/appdata/keystore.jks" || echo "problem with keystore download" + fi +fi + +# if delay is set as an environment variable then wait that long in seconds +if ! [ -z "${DELAY+x}" ]; then + sleep $DELAY +fi + +exec "$@" diff --git a/releases.yaml b/releases.yaml index 4af8e7b..bcf4eb1 100644 --- a/releases.yaml +++ b/releases.yaml @@ -1,5 +1,5 @@ # Specifies which slug should gain the "latest" tags -latest: 4.5.2 +latest: 4.6.0 # Sets the alpine image tag for the downloader stage downloaderTag: 3.24.1 @@ -22,6 +22,23 @@ labels: |- "org.opencontainers.image.version"="{{ .slug }}" versions: + - slug: 4.6.0 + releaseVersion: 4.6.0 + releaseUrl: https://github.com/OpenIntegrationEngine/engine/releases/download/v4.6.0/oie_unix_4_6_0.tar.gz + tags: + - distro: ubuntu + type: jre + tag: 21.0.11_10-jre-resolute + - distro: ubuntu + type: jdk + tag: 21.0.11_10-jdk-resolute + - distro: alpine + type: jre + tag: 21.0.11_10-jre-alpine + - distro: alpine + type: jdk + tag: 21.0.11_10-jdk-alpine + - slug: 4.5.2 releaseVersion: 4.5.2 releaseUrl: https://github.com/OpenIntegrationEngine/engine/releases/download/v4.5.2/oie_unix_4_5_2.tar.gz From 72280133cd46a448542429ba0564a3ed9513e971 Mon Sep 17 00:00:00 2001 From: Kaur Palang Date: Tue, 6 Oct 2026 16:02:25 -0400 Subject: [PATCH 3/5] Reflow and copy-edit README Wrap paragraphs at about 120 columns and fix grammar and punctuation. Also: put `-Xmx512m` in code formatting, refer to the "Ubuntu-based" images instead of "Debian flavored", and explain where engine issues and Docker image issues should be filed. Adapted from BrightCodeCompany/engine-docker@450d8c0 (MPL-2.0). Source commits: 4985e58 b1e6828 e3e8ec2 Modifications from the BCC version: - README.md: Docker image issues point to the OpenIntegrationEngine/engine-docker issue tracker (BCC: BrightCodeCompany/engine-docker). Every image reference uses openintegrationengine/engine (BCC: brightcodecompany/openintegrationengine). The 4.6.0-rc1 tag list is left out. Signed-off-by: Kaur Palang Co-authored-by: Tony Germano Signed-off-by: Tony Germano --- README.md | 142 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 87 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index e4ea478..80a75f8 100644 --- a/README.md +++ b/README.md @@ -27,30 +27,35 @@ - 🌐 **Website**: [openintegrationengine.org](https://openintegrationengine.org) - 💬 **Discord**: [Join our server](https://discord.gg/azdehW2Zrx) -- 📂 **GitHub Repo**: [github.com/OpenIntegrationEngine/engine](https://github.com/OpenIntegrationEngine/engine) +- 📂 **GitHub Repo**: [OpenIntegrationEngine/engine](https://github.com/OpenIntegrationEngine/engine) #### How to file issues: -https://github.com/OpenIntegrationEngine/engine/issues +Issues regarding the Open Integration Engine software are tracked on the [Open Integration Engine GitHub repository](https://github.com/OpenIntegrationEngine/engine/issues), +whereas issues regarding the Docker images are tracked on the [engine-docker GitHub repository](https://github.com/OpenIntegrationEngine/engine-docker/issues). Please do your best to include the following information in your issue: * The exact commit hash of the code you are using * The commands you executed to build or run the image * The output of the command you executed (Hint: add `--progress=plain` to your `docker` command to see the full output) -* Use [Markdown](https://guides.github.com/features/mastering-markdown/) to format your issue text, ESPECIALLY if you are including code snippets or command output. This will make it easier for us to read and understand your issue. +* Use [Markdown](https://guides.github.com/features/mastering-markdown/) to format your issue text, **especially** if +you're including code snippets or command output. This will make it easier for us to read and understand your issue. ------------ # What is Open Integration Engine [↑](#top) -An open-source message integration engine focused on healthcare. For more information please visit [openintegrationengine.org](https://openintegrationengine.org). +An open-source message integration engine focused on healthcare. For more information, please visit +[openintegrationengine.org](https://openintegrationengine.org). -OpenIntegrationEngine is a community-driven project that continues the legacy of Mirth Connect, providing a flexible, open platform for managing healthcare interfaces. It supports a wide range of -healthcare standards and protocols, enabling seamless integration between disparate systems. +OpenIntegrationEngine is a community-driven project that continues the legacy of Mirth Connect, providing a flexible, +open platform for managing healthcare interfaces. It supports a wide range of healthcare standards and protocols, +enabling seamless integration between disparate systems. -OpenIntegrationEngine is designed to be vendor-neutral, allowing healthcare organizations to connect their systems without being locked into proprietary solutions. It offers a user-friendly interface -for building, deploying, and managing interfaces, along with powerful features for real-time monitoring and alerting. +OpenIntegrationEngine is designed to be vendor-neutral, allowing healthcare organizations to connect their systems +without being locked into proprietary solutions. It offers a user-friendly interface for building, deploying, and +managing interfaces, along with powerful features for real-time monitoring and alerting. ------------ @@ -86,7 +91,8 @@ All Open Integration Engine releases are packaged into the following images: # Supported Architectures [↑](#top) -Docker images for OIE 4.5.2 and later versions support both `linux/amd64` and `linux/arm64` architectures. As an example, to pull the latest `linux/arm64` image, use the command +Docker images for OIE 4.5.2 and later versions support both `linux/amd64` and `linux/arm64` architectures. As an +example, to pull the latest `linux/arm64` image, use the command ``` docker pull --platform linux/arm64 openintegrationengine/engine:latest ``` @@ -99,14 +105,15 @@ docker pull --platform linux/arm64 openintegrationengine/engine:latest ## Start an OpenIntegrationEngine instance [↑](#top) -Quickly start OpenIntegration using embedded Derby database and all configuration defaults. At a minimum you will likely want to use the `-p` option to expose the 8443 port so that you can log in with -the Administrator GUI or CLI: +Quickly start OpenIntegrationEngine using embedded Derby database and all configuration defaults. At a minimum you will +likely want to use the `-p` option to expose the 8443 port so that you can log in with the Administrator GUI or CLI: ```bash docker run -p 8443:8443 openintegrationengine/engine ``` -You can also use the `--name` option to give your container a unique name, and the `-d` option to detach the container and run it in the background: +You can also use the `--name` option to give your container a unique name, and the `-d` option to detach the container +and run it in the background: ```bash docker run --name myengine -d -p 8443:8443 openintegrationengine/engine @@ -131,7 +138,8 @@ Look at the [Environment Variables](#environment-variables) section for more ava ## Using [`docker stack deploy`](https://docs.docker.com/engine/reference/commandline/stack_deploy/) or [`docker compose`](https://github.com/docker/compose) [↑](#top) -With `docker stack` or `docker compose` you can easily set up and launch multiple related containers. For example, you might want to launch both Engine *and* a PostgreSQL database to run alongside it. +With `docker stack` or `docker compose` you can easily set up and launch multiple related containers. For example, +you might want to launch both Engine *and* a PostgreSQL database to run alongside it. ```bash docker compose -f stack.yml up @@ -175,7 +183,8 @@ services: ## Environment Variables [↑](#top) -You can use environment variables to configure the [mirth.properties](https://github.com/openintegrationengine/engine/blob/development/server/conf/mirth.properties) file or to add custom JVM options. +You can use environment variables to configure the [mirth.properties](https://github.com/openintegrationengine/engine/blob/development/server/conf/mirth.properties) +file or to add custom JVM options. ### Setting Environment Variables @@ -185,7 +194,8 @@ To set environment variables, use the `-e` option for each variable on the comma docker run -e DATABASE='derby' -p 8443:8443 openintegrationengine/engine ``` -You can also use a separate file containing all of your environment variables using the `--env-file` option. For example let's say you create a file **myenvfile.txt**: +You can also use a separate file containing all of your environment variables using the `--env-file` option. For example, +let's say you create a file **myenvfile.txt**: ```bash DATABASE=postgres @@ -228,12 +238,14 @@ The JDBC URL to use when connecting to the database. For example: #### `DATABASE_USERNAME` -The username to use when connecting to the database. If you don't want to use an environment variable to store sensitive information like this, look at the [Using Docker Secrets](#using-docker-secrets) section below. +The username to use when connecting to the database. If you don't want to use an environment variable to store sensitive +information like this, look at the [Using Docker Secrets](#using-docker-secrets) section below. #### `DATABASE_PASSWORD` -The password to use when connecting to the database. If you don't want to use an environment variable to store sensitive information like this, look at the [Using Docker Secrets](#using-docker-secrets) section below. +The password to use when connecting to the database. If you don't want to use an environment variable to store sensitive +information like this, look at the [Using Docker Secrets](#using-docker-secrets) section below. #### `DATABASE_MAX_CONNECTIONS` @@ -243,23 +255,27 @@ The maximum number of connections to use for the internal messaging engine conne #### `DATABASE_MAX_RETRY` -On startup, if a database connection cannot be made for any reason, Engine will wait and attempt again this number of times. By default, will retry 2 times (so 3 total attempts). +On startup, if a database connection cannot be made for any reason, Engine will wait and attempt again this number of +times. By default, will retry twice (so three total attempts). #### `DATABASE_RETRY_WAIT` -The amount of time (in milliseconds) to wait between database connection attempts. By default, will wait 10 seconds between attempts. +The amount of time (in milliseconds) to wait between database connection attempts. By default, will wait 10 seconds +between attempts. #### `KEYSTORE_STOREPASS` -The password for the keystore file itself. If you don't want to use an environment variable to store sensitive information like this, look at the [Using Docker Secrets](#using-docker-secrets) section below. +The password for the keystore file itself. If you don't want to use an environment variable to store sensitive +information like this, look at the [Using Docker Secrets](#using-docker-secrets) section below. #### `KEYSTORE_KEYPASS` -The password for the keys within the keystore, including the server certificate and the secret encryption key. If you don't want to use an environment variable to store sensitive information like this, -look at the [Using Docker Secrets](#using-docker-secrets) section below. +The password for the keys within the keystore, including the server certificate and the secret encryption key. If you +don't want to use an environment variable to store sensitive information like this, look at the +[Using Docker Secrets](#using-docker-secrets) section below. #### `KEYSTORE_TYPE` @@ -269,27 +285,31 @@ The type of keystore. #### `SESSION_STORE` -If set to true, the web server sessions are stored in the database. This can be useful in situations where you have multiple Engine servers (connecting to the same database) clustered behind a load -balancer. +If set to true, the web server sessions are stored in the database. This can be useful in situations where you have +multiple Engine servers (connecting to the same database) clustered behind a load balancer. #### `VMOPTIONS` -A comma-separated list of JVM command-line options to place in the `.vmoptions` file. For example to set the max heap size: +A comma-separated list of JVM command-line options to place in the `.vmoptions` file. For example, to set the max heap +size: -* -Xmx512m +* `-Xmx512m` #### `DELAY` -This tells the entrypoint script to wait for a certain amount of time (in seconds). The entrypoint script will automatically use a command-line SQL client to check connectivity and wait until the -database is up before starting Engine, but only when using PostgreSQL or MySQL. If you are using Oracle or SQL Server and the database is being started up at the same time as Engine, you may want -to use this option to tell Engine to wait a bit to allow the database time to startup. +This tells the entrypoint script to wait for a certain amount of time (in seconds). The entrypoint script will +automatically use a command-line SQL client to check connectivity and wait until the database is up before starting +Engine, but only when using PostgreSQL or MySQL. If you are using Oracle or SQL Server and the database is being started +up at the same time as Engine, you may want to use this option to tell Engine to wait a bit to allow the database time to +start up. #### `KEYSTORE_DOWNLOAD` -A URL location of a Engine keystore file. This file will be downloaded into the container and Engine will use it as its keystore. +A URL location of an Engine keystore file. This file will be downloaded into the container, and Engine will use it as +its keystore. #### `EXTENSIONS_DOWNLOAD` @@ -299,26 +319,30 @@ A URL location of a zip file containing Engine extension zip files. The extensio #### `CUSTOM_JARS_DOWNLOAD` -A URL location of a zip file containing JAR files. The JAR files will be installed into the `server-launcher-lib` folder on the Engine server, so they will be added to the server's classpath. +A URL location of a zip file containing JAR files. The JAR files will be installed into the `server-launcher-lib` folder +on the Engine server, so they will be added to the server's classpath. #### `ALLOW_INSECURE` -Allow insecure SSL connections when downloading files during startup. This applies to keystore downloads, plugin downloads, and server library downloads. By default, insecure connections are disabled, -but you can enable this option by setting `ALLOW_INSECURE=true`. +Allow insecure SSL connections when downloading files during startup. This applies to keystore downloads, plugin +downloads, and server library downloads. By default, insecure connections are disabled, but you can enable this option +by setting `ALLOW_INSECURE=true`. #### `SERVER_ID` -Set the `server.id` to a specific value. Use this to preserve or set the server ID across restarts and deployments. Using the env-var is preferred over storing `appdata` persistently +Set the `server.id` to a specific value. Use this to preserve or set the server ID across restarts and deployments. +Using the env-var is preferred over storing `appdata` persistently ------------ ### Other mirth.properties options [↑](#top) -Other options in the mirth.properties file can also be changed. Any environment variable starting with the `_MP_` prefix will set the corresponding value in mirth.properties. Replace `.` with a single -underscore `_` and `-` with two underscores `__`. +Other options in the `mirth.properties` file can also be changed. Any environment variable starting with the `_MP_` +prefix will set the corresponding value in mirth.properties. Replace `.` with a single underscore `_` and `-` with two +underscores `__`. Examples: @@ -339,8 +363,8 @@ Examples: ## Using Docker Secrets [↑](#top) -For sensitive information such as the database/keystore credentials, instead of supplying them as environment variables you can use a [Docker Secret](https://docs.docker.com/engine/swarm/secrets/). -There are two secret names this image supports: +For sensitive information such as the database/keystore credentials, instead of supplying them as environment variables, +you can use a [Docker Secret](https://docs.docker.com/engine/swarm/secrets/). There are two secret names this image supports: ##### mirth_properties @@ -354,7 +378,8 @@ If present, any JVM options in this secret will be appended onto the mcserver.vm Secrets are supported with [Docker Swarm](https://docs.docker.com/engine/swarm/secrets/), but you can also use them with [`docker compose`](#using-docker-compose). -For example let's say you wanted to set `keystore.storepass` and `keystore.keypass` in a secure way. You could create a new file, **secret.properties**: +For example, let's say you wanted to set `keystore.storepass` and `keystore.keypass` in a secure way. You could create +a new file, **secret.properties**: ```bash keystore.storepass=changeme @@ -380,9 +405,11 @@ secrets: file: /local/path/to/secret.properties ``` -The **secrets** section at the bottom specifies the local file location for each secret. Change `/local/path/to/secret.properties` to the correct local path and filename. +The **secrets** section at the bottom specifies the local file location for each secret. Change +`/local/path/to/secret.properties` to the correct local path and filename. -Inside the configuration for the Engine container there is also a **secrets** section that lists the secrets you want to include for that container. +Inside the configuration for the Engine container, there is also a **secrets** section that lists the secrets you want +to include for that container. ------------ @@ -392,16 +419,17 @@ Inside the configuration for the Engine container there is also a **secrets** se #### The appdata folder [↑](#top) -The application data directory (appdata) stores configuration files and temporary data created by Engine after starting up. This usually includes the keystore file and the `server.id` file that stores -your server ID. If you are launching Engine as part of a stack/swarm, it's possible the container filesystem is already being preserved. But if not, you may want to consider mounting a **volume** to -preserve the appdata folder. +The application data directory (appdata) stores configuration files and temporary data created by Engine after starting +up. This usually includes the keystore file and the `server.id` file that stores your server ID. If you are launching +Engine as part of a stack/swarm, it's possible the container filesystem is already being preserved. But if not, you may +want to consider mounting a **volume** to preserve the appdata folder. ```bash docker run -v /local/path/to/appdata:/opt/engine/appdata -p 8443:8443 openintegrationengine/engine ``` -The `-v` option makes a local directory from your filesystem available to the Docker container. Create a folder on your local filesystem, then change the `/local/path/to/appdata` part in the example -above to the correct local path. +The `-v` option makes a local directory from your filesystem available to the Docker container. Create a folder on your +local filesystem, then change the `/local/path/to/appdata` part in the example above to the correct local path. You can also configure volumes as part of your `compose.yaml`: @@ -418,14 +446,16 @@ services: #### Additional extensions [↑](#top) -The entrypoint script will automatically look for any `.zip` files in the `/opt/engine/custom-extensions` folder and unzip them into the extensions folder before Engine starts up. -So to launch Engine with any additional extensions not included in the base application, do this: +The entrypoint script will automatically look for any `.zip` files in the `/opt/engine/custom-extensions` folder and +unzip them into the extensions folder before Engine starts up. So to launch Engine with any additional extensions not +included in the base application, do this: ```bash -docker run -v /local/path/to/custom-extensions:/opt/engine/custom-extensions -p 8443:8443 openintegrationengine/engine:latest-ubuntu-jre +docker run -v /path/to/custom-extensions:/opt/engine/custom-extensions -p 8443:8443 openintegrationengine/engine:latest-ubuntu-jre ``` -Create a folder on your local filesystem containing the ZIP files for your additional extensions. Then change the `/local/path/to/custom-extensions` part in the example above to the correct local path. +Create a folder in your local filesystem containing the ZIP files for your additional extensions. Then change the +`/path/to/custom-extensions` part in the example above to the correct local path. As with the appdata example, you can also configure this volume as part of your `compose.yaml`. @@ -433,8 +463,9 @@ As with the appdata example, you can also configure this volume as part of your ## Known Limitations -Currently, only the Debian flavored images support the newest authentication scheme in MySQL 8. All others (the Alpine based images) will need the following to force the MySQL database container to -start using the old authentication scheme: +Currently, only the Ubuntu-based images support the newest authentication scheme in MySQL 8. All others +(the Alpine-based images) will need the following to force the MySQL database container to start using the old +authentication scheme: ```yaml command: --default-authentication-plugin=mysql_native_password @@ -454,7 +485,8 @@ Example: ## Building images -To build the full set of four images (`ubuntu-jre`, `ubuntu-jdk`, `alpine-jre`, and `alpine-jdk`) run the following command in the `dockerfiles//` directory: +To build the full set of four images (`ubuntu-jre`, `ubuntu-jdk`, `alpine-jre`, and `alpine-jdk`) run the following +command in the `dockerfiles//` directory: ```sh docker compose build --build-arg CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") ``` @@ -464,5 +496,5 @@ docker compose build --build-arg CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ") # License [↑](#top) -The Dockerfiles, entrypoint script, and any other files used to build these Docker images are Copyright © NextGen Healthcare and OpenIntegrationEngine contributors. -They are licensed under the [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/). +The Dockerfiles, entrypoint script, and any other files used to build these Docker images are Copyright © NextGen +Healthcare and OpenIntegrationEngine contributors. They are licensed under the [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/). From 8ad2d5481b6c78acfe0fb7b169e8ccbb5ecfdee4 Mon Sep 17 00:00:00 2001 From: Tony Germano Date: Wed, 21 Oct 2026 17:46:15 -0400 Subject: [PATCH 4/5] Build the image matrix from releases.yaml The build workflow listed the versions to build by hand, so adding a release meant editing both releases.yaml and the workflow. A new list-versions job reads the version slugs from releases.yaml with yq, and the build-images matrix uses that list. Signed-off-by: Tony Germano --- .github/workflows/build-and-deploy-images.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-deploy-images.yaml b/.github/workflows/build-and-deploy-images.yaml index bad392c..35330fb 100644 --- a/.github/workflows/build-and-deploy-images.yaml +++ b/.github/workflows/build-and-deploy-images.yaml @@ -11,15 +11,26 @@ on: concurrency: build-images jobs: + list-versions: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.versions.outputs.versions }} + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Read version slugs from releases.yaml + id: versions + run: echo "versions=$(yq -o=json -I=0 '[.versions[].slug]' releases.yaml)" >> "$GITHUB_OUTPUT" + build-images: + needs: list-versions runs-on: ubuntu-latest environment: dockerhub strategy: fail-fast: false matrix: - oie_version: - - 4.5.2 - - 4.6.0 + oie_version: ${{ fromJSON(needs.list-versions.outputs.versions) }} steps: - name: Checkout uses: actions/checkout@v6 From cf0c618a12902410293d7ddccad12c9e364d7fd4 Mon Sep 17 00:00:00 2001 From: Tony Germano Date: Wed, 21 Oct 2026 17:46:24 -0400 Subject: [PATCH 5/5] Remove the engine user's inherited groups on Ubuntu The Ubuntu images rename the base image's "ubuntu" user to "engine". That user is also a member of adm, dialout, cdrom, floppy, sudo, audio, dip, video and plugdev, which the engine does not need. Clear the supplementary groups with `usermod -G ''`, which leaves engine only in its primary group. This replaces `usermod -aG engine engine`, which did nothing because engine is already the primary group. It is a change from the BCC version of templates/Dockerfile.tpl. The Alpine images already create a user with no extra groups. Signed-off-by: Tony Germano --- dockerfiles/4.5.2/Dockerfile | 4 ++-- dockerfiles/4.6.0/Dockerfile | 4 ++-- templates/Dockerfile.tpl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dockerfiles/4.5.2/Dockerfile b/dockerfiles/4.5.2/Dockerfile index 1b99a0d..c8d7f6d 100644 --- a/dockerfiles/4.5.2/Dockerfile +++ b/dockerfiles/4.5.2/Dockerfile @@ -51,7 +51,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && groupmod --new-name engine ubuntu \ && usermod -l engine ubuntu \ - && usermod -aG engine engine + && usermod -G '' engine VOLUME /opt/engine/appdata VOLUME /opt/engine/custom-extensions @@ -85,7 +85,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && groupmod --new-name engine ubuntu \ && usermod -l engine ubuntu \ - && usermod -aG engine engine + && usermod -G '' engine VOLUME /opt/engine/appdata VOLUME /opt/engine/custom-extensions diff --git a/dockerfiles/4.6.0/Dockerfile b/dockerfiles/4.6.0/Dockerfile index 8649974..c8d3c10 100644 --- a/dockerfiles/4.6.0/Dockerfile +++ b/dockerfiles/4.6.0/Dockerfile @@ -51,7 +51,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && groupmod --new-name engine ubuntu \ && usermod -l engine ubuntu \ - && usermod -aG engine engine + && usermod -G '' engine VOLUME /opt/engine/appdata VOLUME /opt/engine/custom-extensions @@ -85,7 +85,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && groupmod --new-name engine ubuntu \ && usermod -l engine ubuntu \ - && usermod -aG engine engine + && usermod -G '' engine VOLUME /opt/engine/appdata VOLUME /opt/engine/custom-extensions diff --git a/templates/Dockerfile.tpl b/templates/Dockerfile.tpl index c9cd82c..4f43d32 100644 --- a/templates/Dockerfile.tpl +++ b/templates/Dockerfile.tpl @@ -62,7 +62,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && groupmod --new-name engine ubuntu \ && usermod -l engine ubuntu \ - && usermod -aG engine engine + && usermod -G '' engine {{- else if eq .distro "alpine" }} RUN apk add --no-cache bash unzip \ && adduser -D -H -u {{ $.config.uid }} engine engine