-
Notifications
You must be signed in to change notification settings - Fork 43
#40 Add initial Dockerfile #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: Build OpenIntegrationEngine Container | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - docker | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - docker | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build Container | ||
| working-directory: docker/ | ||
| run: ./build-images.sh | ||
|
|
||
| - run: docker image ls |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| * | ||
| !entrypoint.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| ARG ALPINE_JRE_TAG=17.0.15_6-jre-alpine | ||
| ARG ALPINE_JDK_TAG=17.0.15_6-jdk-alpine | ||
| ARG UBUNTU_JRE_TAG=17.0.15_6-jre-noble | ||
| ARG UBUNTU_JDK_TAG=17.0.15_6-jdk-noble | ||
|
|
||
| ARG UID=14285 | ||
| ARG GID=14285 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is 14285 significant or just a random number?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Random. It is to try to eliminate conflicts with existing users.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to check some of the nextgen issues, but I think it is desirable to conflict with existing users when doing bind mounts. |
||
|
|
||
| FROM alpine:3.21.3 AS downloader | ||
|
|
||
| ARG UID | ||
| ARG GID | ||
|
|
||
| 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-tp.1/oie_unix_4_5_2.tar.gz \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be an ARG like the nextgen image?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will be. I've yet to figure out how to accommodate both the Github "Release" object and downloading arbitrary artifacts from actions. |
||
| && 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest either the checked-in file should not have the .sh extension or the copy should not change the name and |
||
|
|
||
| RUN rm -rf cli-lib manager-lib \ | ||
| && rm mirth-cli-launcher.jar oiecommand | ||
|
|
||
| RUN (cat oieserver.vmoptions docs/oieservice-java9+.vmoptions ; echo "") > oieserver_base.vmoptions | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this step shouldn't be necessary. Our default vmoptions already include the java 9+ options |
||
|
|
||
| RUN chown -R ${UID}:${GID} /opt/engine | ||
|
|
||
| ########################################## | ||
| # | ||
| # Alpine Images | ||
| # | ||
| ########################################## | ||
|
|
||
| FROM eclipse-temurin:$ALPINE_JRE_TAG AS alpine-jre | ||
|
|
||
| ARG UID | ||
| ARG GID | ||
|
|
||
| COPY --from=downloader /opt/engine /opt/engine | ||
|
|
||
| RUN adduser -D -H -u $UID engine \ | ||
| && apk add --no-cache bash | ||
|
|
||
| VOLUME /opt/engine/appdata | ||
| VOLUME /opt/engine/custom-extensions | ||
| WORKDIR /opt/engine | ||
|
|
||
| EXPOSE 8443 | ||
|
|
||
| USER engine | ||
| ENTRYPOINT ["./entrypoint"] | ||
| CMD ["./oieserver"] | ||
|
|
||
| FROM eclipse-temurin:$ALPINE_JDK_TAG AS alpine-jdk | ||
|
|
||
| ARG UID | ||
| ARG GID | ||
|
|
||
| COPY --from=downloader /opt/engine /opt/engine | ||
|
|
||
| RUN adduser -D -H -u $UID engine \ | ||
| && apk add --no-cache bash | ||
|
|
||
| VOLUME /opt/engine/appdata | ||
| VOLUME /opt/engine/custom-extensions | ||
| WORKDIR /opt/engine | ||
|
|
||
| EXPOSE 8443 | ||
|
|
||
| USER engine | ||
| ENTRYPOINT ["./entrypoint"] | ||
| CMD ["./oieserver"] | ||
|
Comment on lines
+65
to
+83
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to duplicate for JRE and JDK? They are the same, and since the base tag is already an argument, it can be passed from build-images.sh. I understand having two targets for alpine vs ubuntu, since those have differences. |
||
|
|
||
| ########################################## | ||
| # | ||
| # Ubuntu Images | ||
| # | ||
| ########################################## | ||
jonbartels marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| FROM eclipse-temurin:$UBUNTU_JRE_TAG AS ubuntu-jre | ||
|
|
||
| ARG UID | ||
| ARG GID | ||
|
|
||
| COPY --from=downloader /opt/engine /opt/engine | ||
|
|
||
| RUN 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"] | ||
| CMD ["./oieserver"] | ||
|
|
||
| FROM eclipse-temurin:$UBUNTU_JDK_TAG AS ubuntu-jdk | ||
|
|
||
| ARG UID | ||
| ARG GID | ||
|
|
||
| COPY --from=downloader /opt/engine /opt/engine | ||
|
|
||
| RUN 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"] | ||
| CMD ["./oieserver"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Build alpine-jre image | ||
| docker build -f Dockerfile --target alpine-jre -t openintegrationengine/engine:latest-alpine-jre . | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I sent you a patch on Discord to DRY this up and to support arm64 architectures. |
||
| # Build ubuntu-jre image | ||
| docker build -f Dockerfile --target ubuntu-jre -t openintegrationengine/engine:latest-ubuntu-jre . | ||
|
|
||
| # Build alpine-jdk image | ||
| docker build -f Dockerfile --target alpine-jdk -t openintegrationengine/engine:latest-alpine-jdk . | ||
| # Build ubuntu-jdk image | ||
| docker build -f Dockerfile --target ubuntu-jdk -t openintegrationengine/engine:latest-alpine-jdk . | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing newline at end of file |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each of these is ALMOST the same thing.
What about defining "JAVA_VERSION = 17.0.15" then bulding the tags from that so that we have ONE place to update the java version?
Alpine also supports just "17" or "21" do we need the 17.0.5 full notation?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here specifying full tags is better, as realistically, there's not a single standard they're using for tags. So generating them on the fly introduces the risk of finding a non-existing tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a clear standard. The common images use this pattern:
Thus you get the latest 17.whatever.something_patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the full version in the tag rather than just a major version. That's good practice in docker just like it is with software library versions. I think there's a way with dependabot or other bots to have it automatically open PRs to upgrade the version when new ones are released.