Skip to content

Commit

Permalink
Merge pull request #15612 from zhangguanzhang/release-3.5
Browse files Browse the repository at this point in the history
[3.5] Backport fixes all docker images of Architecture show amd64
  • Loading branch information
ahrtr authored Apr 1, 2023
2 parents 1259884 + 77baf66 commit 7230b94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ cp "${BINARYDIR}"/etcd "${BINARYDIR}"/etcdctl "${BINARYDIR}"/etcdutl "${IMAGEDIR
cat ./"${DOCKERFILE}" > "${IMAGEDIR}"/Dockerfile

if [ -z "$TAG" ]; then
docker build -t "gcr.io/etcd-development/etcd:${VERSION}" "${IMAGEDIR}"
docker build -t "quay.io/coreos/etcd:${VERSION}" "${IMAGEDIR}"
# Fix incorrect image "Architecture" using buildkit
# From https://stackoverflow.com/q/72144329/
DOCKER_BUILDKIT=1 docker build -t "gcr.io/etcd-development/etcd:${VERSION}" "${IMAGEDIR}"
DOCKER_BUILDKIT=1 docker build -t "quay.io/coreos/etcd:${VERSION}" "${IMAGEDIR}"
else
docker build -t "${TAG}:${VERSION}" "${IMAGEDIR}"
fi
9 changes: 9 additions & 0 deletions scripts/test_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ fi

echo "Succesfully tested etcd local image ${TAG}"

for TARGET_ARCH in "amd64" "arm64" "ppc64le" "s390x"; do
ARCH_TAG=v"${VERSION}"-"${TARGET_ARCH}"
IMG_ARCH=$(docker inspect --format '{{.Architecture}}' "${REPOSITARY}:${ARCH_TAG}")
if [ "${IMG_ARCH}" != "$TARGET_ARCH" ];then
echo "Incorrect docker image architecture"
exit 1
fi
echo "Correct Architecture ${ARCH_TAG}"
done

0 comments on commit 7230b94

Please sign in to comment.