Skip to content

Commit e075428

Browse files
author
temporal-workflow-backend
committed
Fix ARM64 incompatibility in Dockerfile
1 parent e9409cb commit e075428

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ RUN apk add binutils && jlink \
2525
--output /jre \
2626
--strip-debug
2727

28+
ARG TARGETARCH
2829
FROM alpine:3.20.3
2930
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
3031
ENV PIP_NO_CACHE_DIR=1
3132
RUN <<EOF
3233
set -eu
34+
TAPLO_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "x86_64")
3335

3436
# Install Alpine dependencies
3537
apk add --no-cache --virtual .build-deps \
@@ -40,6 +42,7 @@ apk add --no-cache --virtual .build-deps \
4042
py3-pip \
4143
python3-dev
4244
apk add --no-cache \
45+
clang18-extra-tools \
4346
libxslt \
4447
nodejs \
4548
python3
@@ -81,29 +84,27 @@ npm install -g \
8184
typescript-eslint@8.29.0
8285

8386
# Install Scala dependencies
84-
wget https://github.com/coursier/coursier/releases/download/v2.1.17/coursier -O /bin/coursier
85-
chmod +x /bin/coursier
86-
coursier bootstrap org.scalameta:scalafmt-cli_2.13:3.8.3 \
87+
wget https://github.com/coursier/coursier/releases/download/v2.1.17/coursier.jar -O /bin/coursier.jar
88+
java -jar /bin/coursier.jar bootstrap org.scalameta:scalafmt-cli_2.13:3.8.3 \
8789
-r sonatype:snapshots --main org.scalafmt.cli.Cli \
8890
--standalone \
8991
-o scalafmt
9092

9193
# Install static binaries
92-
wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-32d3ac78/clang-format-18_linux-amd64 -O clang-format
93-
chmod +x clang-format
94+
ln -s /usr/bin/clang-format-18 /clang-format
9495
wget https://github.com/google/google-java-format/releases/download/v1.24.0/google-java-format-1.24.0-all-deps.jar -O google-java-format
9596
wget https://search.maven.org/remotecontent?filepath=com/facebook/ktfmt/0.53/ktfmt-0.53-jar-with-dependencies.jar -O ktfmt
9697
wget https://repo1.maven.org/maven2/com/squareup/sort-gradle-dependencies-app/0.14/sort-gradle-dependencies-app-0.14-all.jar -O gradle-dependencies-sorter
97-
wget https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_linux_amd64 -O shfmt
98+
wget https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_linux_${TARGETARCH} -O shfmt
9899
chmod +x shfmt
99-
wget https://github.com/tamasfe/taplo/releases/download/0.9.3/taplo-linux-x86_64.gz -O taplo.gz
100+
wget https://github.com/tamasfe/taplo/releases/download/0.9.3/taplo-linux-${TAPLO_ARCH}.gz -O taplo.gz
100101
gzip -d taplo.gz
101102
chmod +x taplo
102-
wget https://releases.hashicorp.com/terraform/1.9.8/terraform_1.9.8_linux_amd64.zip -O tf.zip
103+
wget https://releases.hashicorp.com/terraform/1.9.8/terraform_1.9.8_linux_${TARGETARCH}.zip -O tf.zip
103104
unzip tf.zip
104105
rm tf.zip
105106
rm LICENSE.txt
106-
wget https://releases.hashicorp.com/packer/1.14.2/packer_1.14.2_linux_amd64.zip -O packer.zip
107+
wget https://releases.hashicorp.com/packer/1.14.2/packer_1.14.2_linux_${TARGETARCH}.zip -O packer.zip
107108
unzip packer.zip
108109
rm packer.zip
109110

@@ -113,7 +114,7 @@ touch /emptyfile
113114
# Delete unused files found by running `apk add ncdu && ncdu` inside `make shell`
114115
apk del .build-deps
115116
rm -rf \
116-
/bin/coursier \
117+
/bin/coursier.jar \
117118
/black21-venv/lib/python3.11/site-packages/pip \
118119
/black21-venv/lib/python3.11/site-packages/pkg_resources \
119120
/black21-venv/lib/python3.11/site-packages/setuptools \

0 commit comments

Comments
 (0)