Skip to content

Commit

Permalink
Merge pull request #69 from gianarb/fix/move-buildx-to-scritps
Browse files Browse the repository at this point in the history
buildx has some requirements like having a platform
  • Loading branch information
gianarb committed May 19, 2020
2 parents 1c9fd47 + d34fbf2 commit cba3539
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ publishers:
- capp-linux
name: "buildx"
dir: "{{ dir .ArtifactPath }}/capp-linux_linux_{{ .Arch }}"
cmd: 'docker buildx build --push --platform linux/{{ .Arch }} -t packethost/cluster-api-provider-packet:latest-{{ .Arch }} -t packethost/cluster-api-provider-packet:{{ .Tag }}-{{ .Arch }} -f ../../Dockerfile.goreleaser .'
cmd: '../../scripts/multi_arch_docker_release.sh'
env:
- TAG={{ .Tag }}
- ARCH={{ .Arch }}
9 changes: 9 additions & 0 deletions scripts/multi_arch_docker_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

docker buildx create --use --name build --node build --driver-opt network=host
docker buildx build --push --platform linux/${ARCH} \
-t packethost/cluster-api-provider-packet:latest-${ARCH} \
-t packethost/cluster-api-provider-packet:${TAG}-${ARCH} \
-f ../../Dockerfile.goreleaser .

0 comments on commit cba3539

Please sign in to comment.