Skip to content

Commit

Permalink
add back the amd64 platform by default on arm
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiggar committed Nov 23, 2022
1 parent d6d0111 commit ec9e77c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions scripts/builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

set -euo pipefail

# This is used, in concert with scripts/build/_build-server, to run Dark inside the
# devcontainer. There is a strong connection between these files and
# .circleci/config.yml, as well as devcontainer.yaml. Generally, if you add something
# to one of these files, there's an equivalent to be added in both .circleci/config.yml and devcontainer.yaml.
# This is used, in concert with scripts/build/_build-server, to run Dark inside
# the devcontainer. There is a strong connection between these files and
# .circleci/config.yml, as well as devcontainer.yaml. Generally, if you add
# something to one of these files, there's an equivalent to be added in both
# .circleci/config.yml and devcontainer.yaml.

if [[ "${BASH_VERSINFO[0]}" -lt 4 ]]; then
# Because we use `-v`
Expand Down Expand Up @@ -33,7 +34,12 @@ gid=$((gid > 1000 ? gid : 1000))
# --------------
if [[ ! -v NEVER_REBUILD_DOCKER ]]; then
echo "Building docker image"
docker buildx build -t dark --build-arg uid="$(id -u)" --build-arg gid="$gid" .
# Always build for linux/amd64 (new OSX arm machines have emulation). This is
# slow on MacOS but it gets there eventually.
# Most of the work is done to enable arm64 builds, but rescript 9.1.4 won't
# build on arm64 (10 supposedly does), and dotnet won't support building wasm
# until dotnet 8 at the earliest.
docker buildx build --platform linux/amd64 -t dark --build-arg uid="$(id -u)" --build-arg gid="$gid" .

echo "Removing running containers"
c=$(docker ps --filter "name=dark-builder" -q)
Expand Down Expand Up @@ -122,6 +128,7 @@ docker run \
--init \
--rm \
-i \
--platform linux/amd64 \
--dns 8.8.8.8 \
--dns 8.8.4.4 \
--name dark-builder \
Expand Down

0 comments on commit ec9e77c

Please sign in to comment.