Skip to content

Commit

Permalink
Arch check in rebuild also
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Oct 5, 2024
1 parent 1abda59 commit d36a9fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version=$(<VERSION)
version=$(<VERSION) # Read version of Dockerfile from file VERSION

# Set the platform flag if we're on ARM
arch=$(uname -m)
Expand Down
12 changes: 11 additions & 1 deletion rebuild.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/bin/bash

version=$(<VERSION) # Read version of Dockerfile from file VERSION
docker build "$@" -t "openworm/openworm:$version" --no-cache .

# Set the platform flag if we're on ARM
arch=$(uname -m)
if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then
platform_flag="--platform linux/amd64"
else
platform_flag=""
fi

# Rebuild the Docker image
docker build $platform_flag "$@" -t "openworm/openworm:$version" --no-cache .

0 comments on commit d36a9fe

Please sign in to comment.