From 6a5a14b18a8eb6014d6e1f99b27ff36761998013 Mon Sep 17 00:00:00 2001 From: Joshua Humphries Date: Tue, 15 Feb 2022 19:14:17 -0500 Subject: [PATCH] release binaries and docker images for arm64 (#170) * goreleaser creates arm64 release binaries * add multi-arch docker build; includes arm64 --- .goreleaser.yml | 3 +++ releasing/do-release.sh | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0f6eaee..eb1e8ed 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,9 +8,12 @@ builds: goarch: - amd64 - 386 + - arm64 ignore: - goos: darwin goarch: 386 + - goos: windows + goarch: arm64 ldflags: - -s -w -X main.version=v{{.Version}} diff --git a/releasing/do-release.sh b/releasing/do-release.sh index 2ae91f4..83eac6a 100755 --- a/releasing/do-release.sh +++ b/releasing/do-release.sh @@ -40,12 +40,17 @@ $PREFIX git checkout go.mod go.sum # if there are no valid current credentials. $PREFIX docker login echo "$VERSION" > VERSION -$PREFIX docker build -t "fullstorydev/grpcui:${VERSION}" . -rm VERSION + +# Docker Buildx support is included in Docker 19.03 +# Below step installs emulators for different architectures on the host +# This enables running and building containers for below architectures mentioned using --platforms +$PREFIX docker run --privileged --rm tonistiigi/binfmt:qemu-v6.1.0 --install all +# Create a new builder instance +export DOCKER_CLI_EXPERIMENTAL=enabled +$PREFIX docker buildx create --use --name multiarch-builder --node multiarch-builder0 # push to docker hub, both the given version as a tag and for "latest" tag -$PREFIX docker push "fullstorydev/grpcui:${VERSION}" -$PREFIX docker tag "fullstorydev/grpcui:${VERSION}" fullstorydev/grpcui:latest -$PREFIX docker push fullstorydev/grpcui:latest +$PREFIX docker buildx build --platform linux/amd64,linux/arm64 --tag fullstorydev/grpcui:${VERSION} --tag fullstorydev/grpcui:latest --push --progress plain --no-cache . +rm VERSION # Homebrew release