Building multiarch docker image: amd, s390x
This commit is contained in:
parent
59a32e5eb0
commit
5e3b216dfb
|
|
@ -11,8 +11,6 @@ COPY cmd /tmp/fullstorydev/grpcurl/cmd
|
||||||
# and build a completely static binary (so we can use
|
# and build a completely static binary (so we can use
|
||||||
# scratch as basis for the final image)
|
# scratch as basis for the final image)
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
ENV GOOS=linux
|
|
||||||
ENV GOARCH=amd64
|
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on
|
||||||
RUN go build -o /grpcurl \
|
RUN go build -o /grpcurl \
|
||||||
-ldflags "-w -extldflags \"-static\" -X \"main.version=$(cat VERSION)\"" \
|
-ldflags "-w -extldflags \"-static\" -X \"main.version=$(cat VERSION)\"" \
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,15 @@ $PREFIX git checkout go.mod go.sum
|
||||||
# if there are no valid current credentials.
|
# if there are no valid current credentials.
|
||||||
$PREFIX docker login
|
$PREFIX docker login
|
||||||
echo "$VERSION" > VERSION
|
echo "$VERSION" > VERSION
|
||||||
$PREFIX docker build -t "fullstorydev/grpcurl:${VERSION}" .
|
|
||||||
rm VERSION
|
# Enable qemu and binfmt support
|
||||||
|
$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
|
||||||
# push to docker hub, both the given version as a tag and for "latest" tag
|
# push to docker hub, both the given version as a tag and for "latest" tag
|
||||||
$PREFIX docker push "fullstorydev/grpcurl:${VERSION}"
|
$PREFIX docker buildx build --platform linux/amd64,linux/s390x --tag fullstorydev/grpcurl:${VERSION} --tag fullstorydev/grpcurl:latest --push --progress plain --no-cache .
|
||||||
$PREFIX docker tag "fullstorydev/grpcurl:${VERSION}" fullstorydev/grpcurl:latest
|
rm VERSION
|
||||||
$PREFIX docker push fullstorydev/grpcurl:latest
|
|
||||||
|
|
||||||
# Homebrew release
|
# Homebrew release
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue