Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to push images with multiple tags #2748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ steps:
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- REGISTRY=gcr.io/k8s-ingress-image-push
- VERSION=$_PULL_BASE_REF
- VERSION="${_PULL_BASE_REF} infrastructure-public-image-${_PULL_BASE_REF}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: VERSIONS ?

- VERBOSE=1
- HOME=/root
- USER=root
Expand Down
31 changes: 17 additions & 14 deletions hack/push-multiarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,25 @@ curl -sL "https://github.com/google/go-containerregistry/releases/download/v0.15

for binary in ${BINARIES}
do
# "arm64 amd64" ---> "linux/arm64,linux/amd64"
# "arm64 amd64" ---> "linux/arm64,linux/amd64"
PLATFORMS="linux/$(echo ${ALL_ARCH} | sed 's~ ~,linux/~g')"
echo "docker buildx platform parameters: ${PLATFORMS}"
MULTIARCH_IMAGE="${REGISTRY}/ingress-gce-${binary}:${VERSION}"
echo "building ${MULTIARCH_IMAGE} image.."
docker buildx build --push \
--platform ${PLATFORMS} \
--tag ${MULTIARCH_IMAGE} \
-f Dockerfile.${binary} .
echo "done, pushed $MULTIARCH_IMAGE image"

# Tag arch specific images for the legacy registries
for arch in ${ALL_ARCH}
for version in ${VERSION}
do
# krane is a variation of crane that supports k8s auth
./krane copy --platform linux/${arch} ${MULTIARCH_IMAGE} ${REGISTRY}/ingress-gce-${binary}-${arch}:${VERSION}
MULTIARCH_IMAGE="${REGISTRY}/ingress-gce-${binary}:${version}"
echo "building ${MULTIARCH_IMAGE} image.."
docker buildx build --push \
--platform ${PLATFORMS} \
--tag ${MULTIARCH_IMAGE} \
-f Dockerfile.${binary} .
echo "done, pushed $MULTIARCH_IMAGE image"

# Tag arch specific images for the legacy registries
for arch in ${ALL_ARCH}
do
# krane is a variation of crane that supports k8s auth
./krane copy --platform linux/${arch} ${MULTIARCH_IMAGE} ${REGISTRY}/ingress-gce-${binary}-${arch}:${version}
done
echo "images are copied to arch specific registries"
done
echo "images are copied to arch specific registries"
done