|
| 1 | +# syntax=docker/dockerfile:1 |
| 2 | + |
| 3 | +ARG ALPINE_TAG |
| 4 | +ARG UBUNTU_TAG |
| 5 | + |
| 6 | +ARG OIE_RELEASE_VERSION |
| 7 | + |
| 8 | +ARG UID=14285 |
| 9 | +ARG GID=14285 |
| 10 | + |
| 11 | +FROM alpine:3.21.3 AS downloader |
| 12 | + |
| 13 | +ARG UID |
| 14 | +ARG GID |
| 15 | +ARG OIE_RELEASE_URL |
| 16 | + |
| 17 | +WORKDIR /opt |
| 18 | + |
| 19 | +# Download Open Integration Engine release |
| 20 | +RUN apk add --no-cache curl \ |
| 21 | + && curl -L \ |
| 22 | + -o /opt/engine.tar.gz \ |
| 23 | + -H "Accept: application/vnd.github+json" \ |
| 24 | + -H "X-GitHub-Api-Version: 2022-11-28" \ |
| 25 | + ${OIE_RELEASE_URL}\ |
| 26 | + && tar xzf engine.tar.gz \ |
| 27 | + && mv /opt/oie /opt/engine \ |
| 28 | + && mkdir -p /opt/engine/appdata |
| 29 | + |
| 30 | +WORKDIR /opt/engine |
| 31 | +COPY --chmod=755 entrypoint.sh /opt/engine/entrypoint.sh |
| 32 | + |
| 33 | +RUN rm -rf cli-lib manager-lib \ |
| 34 | + && rm mirth-cli-launcher.jar oiecommand |
| 35 | + |
| 36 | +RUN chown -R ${UID}:${GID} /opt/engine |
| 37 | + |
| 38 | +########################################## |
| 39 | +# |
| 40 | +# Alpine Images |
| 41 | +# |
| 42 | +########################################## |
| 43 | + |
| 44 | +FROM eclipse-temurin:$ALPINE_TAG AS alpine |
| 45 | + |
| 46 | +ARG UID |
| 47 | +ARG GID |
| 48 | +ARG OIE_RELEASE_VERSION |
| 49 | +ARG CREATED_AT |
| 50 | + |
| 51 | +# Add OCI best-practice labels https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys |
| 52 | +LABEL "org.opencontainers.image.authors"="Open Integration Engine" \ |
| 53 | + "org.opencontainers.image.created"="${CREATED_AT?:}" \ |
| 54 | + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ |
| 55 | + "org.opencontainers.image.licenses"="MPL-2.0" \ |
| 56 | + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ |
| 57 | + "org.opencontainers.image.title"="Open Integration Engine" \ |
| 58 | + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ |
| 59 | + "org.opencontainers.image.vendor"="Open Integration Engine" \ |
| 60 | + "org.opencontainers.image.version"="${OIE_RELEASE_VERSION?:}" |
| 61 | + |
| 62 | +COPY --from=downloader /opt/engine /opt/engine |
| 63 | + |
| 64 | +RUN apk add --no-cache bash \ |
| 65 | + && adduser -D -H -u $UID engine engine # Create both group and user "engine" at the same time |
| 66 | + |
| 67 | +VOLUME /opt/engine/appdata |
| 68 | +VOLUME /opt/engine/custom-extensions |
| 69 | +WORKDIR /opt/engine |
| 70 | + |
| 71 | +EXPOSE 8443 |
| 72 | + |
| 73 | +USER engine |
| 74 | +ENTRYPOINT ["./entrypoint.sh"] |
| 75 | +CMD ["./oieserver"] |
| 76 | + |
| 77 | +########################################## |
| 78 | +# |
| 79 | +# Ubuntu Image |
| 80 | +# |
| 81 | +########################################## |
| 82 | + |
| 83 | +FROM eclipse-temurin:$UBUNTU_TAG AS ubuntu |
| 84 | + |
| 85 | +ARG UID |
| 86 | +ARG GID |
| 87 | +ARG OIE_RELEASE_VERSION |
| 88 | +ARG CREATED_AT |
| 89 | + |
| 90 | +# Add OCI best-practice labels https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys |
| 91 | +LABEL "org.opencontainers.image.authors"="Open Integration Engine" \ |
| 92 | + "org.opencontainers.image.created"="${CREATED_AT?:}" \ |
| 93 | + "org.opencontainers.image.description"="An open source fork of the now closed-source Mirth Connect" \ |
| 94 | + "org.opencontainers.image.licenses"="MPL-2.0" \ |
| 95 | + "org.opencontainers.image.source"="https://github.com/OpenIntegrationEngine/engine-docker" \ |
| 96 | + "org.opencontainers.image.title"="Open Integration Engine" \ |
| 97 | + "org.opencontainers.image.url"="https://github.com/OpenIntegrationEngine/engine" \ |
| 98 | + "org.opencontainers.image.vendor"="Open Integration Engine" \ |
| 99 | + "org.opencontainers.image.version"="${OIE_RELEASE_VERSION?:}" |
| 100 | + |
| 101 | +COPY --from=downloader /opt/engine /opt/engine |
| 102 | + |
| 103 | +RUN groupadd --gid ${GID} engine \ |
| 104 | + && useradd -u ${UID} -g ${GID} -M engine |
| 105 | + |
| 106 | +VOLUME /opt/engine/appdata |
| 107 | +VOLUME /opt/engine/custom-extensions |
| 108 | +WORKDIR /opt/engine |
| 109 | + |
| 110 | +EXPOSE 8443 |
| 111 | + |
| 112 | +USER engine |
| 113 | +ENTRYPOINT ["./entrypoint.sh"] |
| 114 | +CMD ["./oieserver"] |
0 commit comments