Skip to content

Commit

Permalink
Fixes: #15266 All docker images of Architecture show amd64
Browse files Browse the repository at this point in the history
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
  • Loading branch information
zhangguanzhang committed Mar 31, 2023
1 parent 418010b commit 426be57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,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
8 changes: 8 additions & 0 deletions scripts/test_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,11 @@ fi

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

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

0 comments on commit 426be57

Please sign in to comment.