Skip to content

Commit

Permalink
explicitly set docker platform to linux/amd64 for compatibility with …
Browse files Browse the repository at this point in the history
…docker-desktop on darwin/arm64 hosts
  • Loading branch information
davidalpert committed Apr 13, 2022
1 parent 7392795 commit 7546162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ linux-arm-64:
build-docker: docker-build

docker-build:
docker build -t godbledger:$(VERSION) -t godbledger:latest -f ./utils/Dockerfile.build .
docker build --platform linux/amd64 -t godbledger:$(VERSION) -t godbledger:latest -f ./utils/Dockerfile.build .

docker-login:
@$(if $(strip $(shell docker ps | grep godbledger-server)), @docker exec -it godbledger-server /bin/ash || 0, @docker run -it --rm --entrypoint /bin/ash godbledger:$(VERSION) )

docker-start:
GDBL_DATA_DIR=$(GDBL_DATA_DIR) GDBL_LOG_LEVEL=$(GDBL_LOG_LEVEL) GDBL_VERSION=$(VERSION) docker-compose up
DOCKER_DEFAULT_PLATFORM=linux/amd64 GDBL_DATA_DIR=$(GDBL_DATA_DIR) GDBL_LOG_LEVEL=$(GDBL_LOG_LEVEL) GDBL_VERSION=$(VERSION) docker-compose up

docker-stop:
docker-compose down
Expand Down
4 changes: 2 additions & 2 deletions utils/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15.5-alpine AS builder
FROM --platform=linux/amd64 golang:1.15.5-alpine AS builder
# https://megamorf.gitlab.io/2019/09/08/alpine-go-builds-with-cgo-enabled/

RUN apk update
Expand All @@ -12,7 +12,7 @@ ADD . .
# TODO: pull app version from VERSION
RUN make

FROM alpine
FROM --platform=linux/amd64 alpine

# netcat is needed by wait-for
RUN apk add net-tools
Expand Down

0 comments on commit 7546162

Please sign in to comment.