Skip to content

Commit 8c06032

Browse files
committed
Allow regular builds and ARM64 builds through POSIX shell
buildx sets the env var if we specify it. Regular docker build doesn't seem to do so. This solution is not pretty but it tackles the cases we're trying to support now. Perhaps this will make Apple happy.
1 parent 50ad52b commit 8c06032

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ FROM node:20-bookworm
33
LABEL maintainer="[email protected]"
44

55
RUN apt-get update && apt-get -y upgrade && apt-get -y install git openssh-client rsync jq
6-
RUN if [[ "$TARGETPLATFORM" -eq "linux/amd64" ]]; then \
7-
cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-x86_64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-x86_64-unknown-linux-gnu.deb; \
8-
elif [[ "$TARGETPLATFORM" -eq "linux/arm64" ]]; then \
9-
cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-aarch64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-aarch64-unknown-linux-gnu.deb; \
6+
ARG TARGETPLATFORM
7+
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
8+
echo "BUILDING FOR AMD64 through $TARGETPLATFORM"; cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-x86_64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-x86_64-unknown-linux-gnu.deb; \
9+
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
10+
echo "BUILDING FOR ARM64" && cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-aarch64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-aarch64-unknown-linux-gnu.deb; \
11+
elif [ "$TARGETPLATFORM" = "" ]; then \
12+
echo "BUILDING FOR AMD64 through $TARGETPLATFORM"; cd /tmp/ && wget https://github.com/watchexec/watchexec/releases/download/v2.3.2/watchexec-2.3.2-x86_64-unknown-linux-gnu.deb && dpkg -i watchexec-2.3.2-x86_64-unknown-linux-gnu.deb; \
1013
else \
11-
echo "$TARGETPLATFORM not supported, check watchexec" ; \
14+
echo "Target platform \"$TARGETPLATFORM\" not supported, check watchexec" ; \
15+
exit 1; \
1216
fi
1317

1418
ENV MU_SPARQL_ENDPOINT='http://database:8890/sparql'

0 commit comments

Comments
 (0)