Skip to content

Commit d36a9fe

Browse files
committed
Arch check in rebuild also
1 parent 1abda59 commit d36a9fe

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
version=$(<VERSION)
3+
version=$(<VERSION) # Read version of Dockerfile from file VERSION
44

55
# Set the platform flag if we're on ARM
66
arch=$(uname -m)

rebuild.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
#!/bin/bash
22

33
version=$(<VERSION) # Read version of Dockerfile from file VERSION
4-
docker build "$@" -t "openworm/openworm:$version" --no-cache .
4+
5+
# Set the platform flag if we're on ARM
6+
arch=$(uname -m)
7+
if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then
8+
platform_flag="--platform linux/amd64"
9+
else
10+
platform_flag=""
11+
fi
12+
13+
# Rebuild the Docker image
14+
docker build $platform_flag "$@" -t "openworm/openworm:$version" --no-cache .

0 commit comments

Comments
 (0)