Skip to content

Commit 4a1d7c7

Browse files
kpalangjonbartels
authored andcommitted
Set up Dockerfile and surrounding tools
Signed-off-by: Kaur Palang <kaur.palang@brightcodecompany.com>
1 parent a132d3f commit 4a1d7c7

8 files changed

Lines changed: 483 additions & 0 deletions

File tree

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
8+
[{*.yml,*.yaml}]
9+
indent_style = space
10+
indent_size = 2
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build production images
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
build-images:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Set up Docker Compose
23+
uses: docker/setup-compose-action@v1
24+
25+
- name: Build images
26+
working-directory: deploy
27+
run: |
28+
docker compose --progress plain build --build-arg CREATED_AT=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
29+
docker image ls
30+
31+
- name: Login to Docker Hub
32+
uses: docker/login-action@v3
33+
with:
34+
username: ${{ vars.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
- name: Push images to Docker hub
38+
run: docker image push --all-tags openintegrationengine/engine

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

deploy/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!entrypoint.sh

deploy/.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
UBUNTU_JRE_TAG=17.0.15_6-jre-noble
2+
UBUNTU_JDK_TAG=17.0.15_6-jdk-noble
3+
4+
ALPINE_JRE_TAG=17.0.15_6-jre-alpine
5+
ALPINE_JDK_TAG=17.0.15_6-jdk-alpine
6+
7+
OIE_RELEASE_VERSION=4.5.2-tp.1
8+
OIE_RELEASE_URL=https://github.com/OpenIntegrationEngine/engine/releases/download/v4.5.2-tp.1/oie_unix_4_5_2.tar.gz

deploy/Dockerfile

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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"="The Open Integration Engine Project and contributors" \
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"="The Open Integration Engine Project" \
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"="The Open Integration Engine Project and contributors" \
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"="The Open Integration Engine Project" \
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"]

deploy/compose.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: open-integration-engine
2+
3+
services:
4+
ubuntu-jdk:
5+
image: openintegrationengine/engine
6+
build:
7+
dockerfile: Dockerfile
8+
target: ubuntu
9+
context: .
10+
args: &jdk-args
11+
UBUNTU_TAG: ${UBUNTU_JDK_TAG:?}
12+
ALPINE_TAG: ${ALPINE_JDK_TAG:?}
13+
OIE_RELEASE_VERSION: ${OIE_RELEASE_VERSION:?}
14+
OIE_RELEASE_URL: ${OIE_RELEASE_URL:?}
15+
platforms: &platforms
16+
- linux/amd64
17+
# - linux/arm64
18+
tags:
19+
- openintegrationengine/engine:latest-ubuntu-jdk
20+
- openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-ubuntu-jdk
21+
22+
ubuntu-jre:
23+
image: openintegrationengine/engine
24+
build:
25+
dockerfile: Dockerfile
26+
target: ubuntu
27+
context: .
28+
args: &jre-tags
29+
UBUNTU_TAG: ${UBUNTU_JRE_TAG:?}
30+
ALPINE_TAG: ${ALPINE_JRE_TAG:?}
31+
OIE_RELEASE_VERSION: ${OIE_RELEASE_VERSION:?}
32+
OIE_RELEASE_URL: ${OIE_RELEASE_URL:?}
33+
platforms: *platforms
34+
tags:
35+
- openintegrationengine/engine:latest-ubuntu
36+
- openintegrationengine/engine:latest-ubuntu-jre
37+
- openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-ubuntu
38+
- openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-ubuntu-jre
39+
40+
alpine-jdk:
41+
image: openintegrationengine/engine
42+
build:
43+
dockerfile: Dockerfile
44+
target: alpine
45+
context: .
46+
args: *jdk-args
47+
platforms: *platforms
48+
tags:
49+
- openintegrationengine/engine:latest-alpine-jdk
50+
- openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-alpine-jre
51+
52+
alpine-jre:
53+
image: openintegrationengine/engine
54+
build:
55+
dockerfile: Dockerfile
56+
target: alpine
57+
context: .
58+
args: *jre-tags
59+
platforms: *platforms
60+
tags:
61+
- openintegrationengine/engine:latest
62+
- openintegrationengine/engine:latest-alpine
63+
- openintegrationengine/engine:latest-alpine-jre
64+
- openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-alpine
65+
- openintegrationengine/engine:${OIE_RELEASE_VERSION?:}-alpine-jre

0 commit comments

Comments
 (0)