-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile.multi
More file actions
98 lines (82 loc) · 3.26 KB
/
Dockerfile.multi
File metadata and controls
98 lines (82 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# run one of these two commands:
#
# 1. (ONCE TO BUILD THE CONTAINER)
# 1a. (ON AMD ARCH)
# docker buildx build --no-cache -f Dockerfile.multi --platform linux/amd64 -t fbpmn-cli-java21-multi . --load
# 1b. (ON ARM ARCH)
# docker buildx build --no-cache -f Dockerfile.multi --platform linux/arm64 -t fbpmn-cli-java21-multi . --load
#
# --no-cache is used to avoid having docker cache the cloning of the fbpmn repository
# this is not very efficient ... (TODO: other strategies are possible)
#
# then run these two commands:
#
# 2. (EACH TIME YOU WANT TO USE THE CONTAINER)
#
# docker run -it fbpmn-cli-java21-multi
#
# 3. (IN THE CONTAINER, TO PERFORM A VERIFICATION)
#
# fbpmn-check $FBPMN_HOME/models/bpmn-origin/src/e033MBE.bpmn 2
# - `--platform linux/amd64`: tested on:
# - n/a
# - `--platform linux/arm64`: tested on:
# - macOS 15.7 / M1 MAX (2026-03-04)
# side notes.
# docker buildx create --f Dockerfile.multi --name multiarch-builder --use
# docker buildx inspect --bootstrap
# docker buildx build --platform linux/amd64,linux/arm64 -t fbpmn-cli-java21 . --push
FROM --platform=$BUILDPLATFORM haskell:9.6
ARG TARGETARCH
RUN echo "$TARGETARCH"
RUN apt-get update && apt-get install -y \
curl \
git \
wget \
unzip \
xz-utils \
libicu-dev \
libssl-dev \
libkrb5-dev \
libcurl4-openssl-dev \
liblttng-ust-dev \
libunwind8 \
ca-certificates \
apt-transport-https \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
RUN if [ "$TARGETARCH" = "arm64" ]; then \
POWERSHELL_URL="https://github.com/PowerShell/PowerShell/releases/download/v7.5.2/powershell-7.5.2-linux-arm64.tar.gz"; \
else \
POWERSHELL_URL="https://github.com/PowerShell/PowerShell/releases/download/v7.5.2/powershell-7.5.2-linux-x64.tar.gz"; \
fi && \
wget "$POWERSHELL_URL" -O /tmp/powershell.tar.gz && \
mkdir -p /opt/microsoft/powershell/7 && \
tar -xzf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 && \
chmod +x /opt/microsoft/powershell/7/pwsh && \
ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh && \
rm /tmp/powershell.tar.gz
RUN if [ "$TARGETARCH" = "arm64" ]; then \
JAVA_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.1_12.tar.gz"; \
else \
JAVA_URL="https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz"; \
fi && \
mkdir -p /opt/java && \
wget "$JAVA_URL" -O /tmp/java.tar.gz && \
tar -xzf /tmp/java.tar.gz -C /opt/java --strip-components=1 && \
rm /tmp/java.tar.gz
ENV JAVA_HOME=/opt/java
ENV PATH="${JAVA_HOME}/bin:$PATH"
WORKDIR /opt/fbpmn
RUN git clone --branch master https://github.com/pascalpoizat/fbpmn.git .
ENV FBPMN_HOME=/opt/fbpmn
RUN stack setup && \
stack build --only-dependencies && \
stack build && \
stack install
RUN curl -L -o tla2tools.jar https://github.com/tlaplus/tlaplus/releases/download/v1.7.4/tla2tools.jar
RUN cp scripts/fbpmn-check scripts/fbpmn-log-transform /usr/local/bin/ && \
chmod +x /usr/local/bin/fbpmn-check /usr/local/bin/fbpmn-log-transform
ENV TLA2TOOLS_HOME=/opt/fbpmn
ENV PATH="/root/.local/bin:${PATH}"
CMD ["/bin/bash"]