Skip to content

Commit

Permalink
auto-detect arm platform in build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tijszwinkels committed Jul 5, 2024
1 parent a24bdec commit e29a775
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 e29a775

Please sign in to comment.