Skip to content

Commit

Permalink
Merge pull request #355 from tijszwinkels/detect-arm
Browse files Browse the repository at this point in the history
auto-detect arm platform in build.sh
  • Loading branch information
pgleeson authored Aug 15, 2024
2 parents 0f68b03 + e29a775 commit 259750b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions build.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" .
version=$(<VERSION)

# 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

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

0 comments on commit 259750b

Please sign in to comment.