Skip to content

Commit 46cabae

Browse files
committed
chore: upgrade docker
1 parent d122a99 commit 46cabae

File tree

3 files changed

+30
-64
lines changed

3 files changed

+30
-64
lines changed
Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,38 @@
1-
FROM mono:6.12
1+
FROM --platform=$BUILDPLATFORM eclipse-temurin:17-jdk-jammy
2+
23
ARG MENDIX_VERSION
4+
ARG BUILDPLATFORM
35

6+
SHELL ["/bin/bash", "-c"]
47
RUN \
5-
echo "Installing Java..." && \
6-
apt-get -qq update && \
7-
apt-get -qq install -y wget && \
8-
wget -q https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz -O /tmp/openjdk.tar.gz && \
9-
mkdir /usr/lib/jvm && \
10-
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm && \
11-
rm /tmp/openjdk.tar.gz && \
12-
\
13-
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
14-
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz && \
15-
mkdir /tmp/mxbuild && \
16-
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild && \
17-
rm /tmp/mxbuild.tar.gz && \
8+
echo "Downloading mxbuild ${MENDIX_VERSION} and docker building for ${BUILDPLATFORM}..." \
9+
&& case "${BUILDPLATFORM}" in \
10+
linux/arm64) \
11+
BINARY_URL="https://cdn.mendix.com/runtime/arm64-mxbuild-${MENDIX_VERSION}.tar.gz"; \
12+
;; \
13+
linux/amd64) \
14+
BINARY_URL="https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz"; \
15+
;; \
16+
*) \
17+
echo "Unsupported architecture: ${BUILDPLATFORM}" >&2; \
18+
exit 1; \
19+
;; \
20+
esac \
21+
&& echo "Downloading from: ${BINARY_URL}" \
22+
&& wget -q "${BINARY_URL}" -O /tmp/mxbuild.tar.gz \
23+
&& mkdir /tmp/mxbuild \
24+
&& tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild \
25+
&& rm /tmp/mxbuild.tar.gz && \
1826
\
19-
apt-get -qq remove -y wget && \
27+
apt-get update -qqy && \
28+
apt-get install -qqy libicu70 libgdiplus && \
29+
apt-get -qqy remove --auto-remove wget && \
2030
apt-get clean && \
2131
\
2232
echo "#!/bin/bash -x" >/bin/mxbuild && \
23-
echo "mono /tmp/mxbuild/modeler/mxbuild.exe --java-home=/usr/lib/jvm/jdk-11.0.2 --java-exe-path=/usr/lib/jvm/jdk-11.0.2/bin/java \$@" >>/bin/mxbuild && \
33+
echo "/tmp/mxbuild/modeler/mxbuild --java-home=/opt/java/openjdk --java-exe-path=/opt/java/openjdk/bin/java \$@" >>/bin/mxbuild && \
2434
chmod +x /bin/mxbuild && \
2535
\
2636
echo "#!/bin/bash -x" >/bin/mx && \
27-
echo "mono /tmp/mxbuild/modeler/mx.exe \$@" >>/bin/mx && \
37+
echo "/tmp/mxbuild/modeler/mx \$@" >>/bin/mx && \
2838
chmod +x /bin/mx

automation/utils/docker/mxbuildMx10.Dockerfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

automation/utils/src/mpk.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ async function ensureMxBuildDockerImageExists(mendixVersion: Version): Promise<v
99
const existingImages = (await exec(`docker image ls -q mxbuild:${version}`, { stdio: "pipe" })).stdout.trim();
1010
if (!existingImages) {
1111
console.log(`Creating new mxbuild:${version} docker image...`);
12-
const versionMajor = mendixVersion.major;
13-
const dockerfilePath =
14-
versionMajor < 10
15-
? join(__dirname, "../docker/mxbuild.Dockerfile")
16-
: join(__dirname, "../docker/mxbuildMx10.Dockerfile");
12+
const dockerfilePath = join(__dirname, "../docker/mxbuild.Dockerfile");
1713
await exec(
1814
`docker build -f ${dockerfilePath} ` +
1915
`--build-arg MENDIX_VERSION=${version} ` +
@@ -45,10 +41,8 @@ export async function createModuleMpkInDocker(
4541
"&&",
4642

4743
// and create module
48-
versionMajor < 10 ? "mono" : "",
49-
versionMajor >= 10
50-
? "/tmp/mxbuild/modeler/mx create-module-package"
51-
: "/tmp/mxbuild/modeler/mxutil.exe create-module-package",
44+
versionMajor < 10 ? "/tmp/mxbuild/modeler/mxutil" : "/tmp/mxbuild/modeler/mx",
45+
"create-module-package",
5246
excludeFilesRegExp ? `--exclude-files='${excludeFilesRegExp}'` : "",
5347
`/source/${projectFile}`,
5448
moduleName

0 commit comments

Comments
 (0)