Skip to content

Instantly share code, notes, and snippets.

@petrjahoda
Last active April 29, 2022 07:35
Show Gist options
  • Save petrjahoda/8a717989ef381e59bfbc5e7f05246a86 to your computer and use it in GitHub Desktop.
Save petrjahoda/8a717989ef381e59bfbc5e7f05246a86 to your computer and use it in GitHub Desktop.
script
name=${PWD##*/}
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o linux/amd64/"$name"
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o linux/arm64/"$name"
upx --best --lzma linux/amd64/"$name"
upx --best --lzma linux/arm64/"$name"
docker rmi -f petrjahoda/"$name":latest
docker buildx build -t petrjahoda/"$name":latest --platform=linux/arm64,linux/amd64 . --push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment