Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <noreply@github.com>
  • Loading branch information
code-elinka authored May 19, 2023
1 parent 8dead19 commit 6736260
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.e2e-test
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# and has curl, gcloud, and ca-certificated preinstalled
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:debian_component_based

#ARG_ARCH & ARG_BIN are replaces with sed in build/rules.mk
ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
ARG TARGETARCH
ADD bin/${TARGETARCH}/e2e-test /e2e-test
COPY cmd/e2e-test/run.sh /run.sh

ENTRYPOINT ["/run.sh"]
28 changes: 8 additions & 20 deletions hack/push-multiarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,15 @@ docker buildx create --use

for binary in ${BINARIES}
do
# "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}"
MANIFEST_PARAMETERS=""
for arch in ${ALL_ARCH}
do
echo "building pushing a docker image for $binary and $arch.."
# creates arch dependant dockerfiles for every binary
sed \
-e "s|ARG_ARCH|${arch}|g" \
-e "s|ARG_BIN|${binary}|g" \
"Dockerfile.${binary}" > ".dockerfile-${arch}.${binary}"

# buildx builds and pushes images for any arch
IMAGE_NAME="${REGISTRY}/ingress-gce-${binary}-$arch"
docker buildx build --platform=linux/$arch \
-f ".dockerfile-${arch}.${binary}" \
-t "${IMAGE_NAME}:${VERSION}" --push .
MANIFEST_PARAMETERS="$MANIFEST_PARAMETERS ${IMAGE_NAME}:${VERSION}"
done

echo "creating a multiatch manifest $MULTIARCH_IMAGE from a list of images.."
docker manifest create ${MULTIARCH_IMAGE}:${VERSION} ${MANIFEST_PARAMETERS}
docker manifest push ${MULTIARCH_IMAGE}:${VERSION}
echo "building ${MULTIARCH_IMAGE}:${VERSION} image.."
docker buildx build --push \
--platform ${PLATFORMS} \
--tag ${MULTIARCH_IMAGE} \
-f Dockerfile.${binary} .
echo "done, pushed $MULTIARCH_IMAGE:$VERSION image"
done

0 comments on commit 6736260

Please sign in to comment.