Skip to content

Commit

Permalink
docker: fix non-release arm64 Ubuntu builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 25, 2024
1 parent ab5b721 commit a1e902f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions docker/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,12 @@ EOF
echo "Fetching digest for ${BASE_IMAGE} ${ARCH_PLATFORMS}..."
ARCH_PLATFORM_ARCH=$(echo ${ARCH_PLATFORMS} | sed "s/linux\///")

# Below no longer works with recent Ubuntu images with Docker client < 23.0.0
# Cf https://github.com/moby/moby/issues/44898
#TARGET_BASE_IMAGE_DIGEST=$(docker manifest inspect ${BASE_IMAGE} | jq --raw-output '.manifests[] | (if .platform.architecture == "'${ARCH_PLATFORM_ARCH}'" then .digest else empty end)')
# So workaround the issue by pulling explicitly the image
docker pull arm64v8/${BASE_IMAGE}
TARGET_BASE_IMAGE_DIGEST=$(docker inspect arm64v8/${BASE_IMAGE} | jq --raw-output '.[0].Id')
docker pull --platform "${ARCH_PLATFORMS}" arm64v8/${BASE_IMAGE}
TARGET_BASE_IMAGE=$(docker inspect arm64v8/${BASE_IMAGE} | jq --raw-output '.[0].RepoDigests[1]')

echo "${TARGET_BASE_IMAGE_DIGEST}"
echo "TARGET_BASE_IMAGE"
BUILD_ARGS+=("--build-arg" "TARGET_ARCH=${ARCH_PLATFORM_ARCH}")
#BUILD_ARGS+=("--build-arg" "TARGET_BASE_IMAGE=${BASE_IMAGE}@${TARGET_BASE_IMAGE_DIGEST}")
BUILD_ARGS+=("--build-arg" "TARGET_BASE_IMAGE=arm64v8/${BASE_IMAGE}")
BUILD_ARGS+=("--build-arg" "TARGET_BASE_IMAGE=${TARGET_BASE_IMAGE}")
# echo "${BUILD_ARGS[@]}"
fi
elif test "${DOCKER_BUILDX}" != "buildx" -a \( "${IMAGE_NAME}" = "osgeo/gdal:alpine-small-latest" -o "${IMAGE_NAME}" = "osgeo/gdal:alpine-normal-latest" \); then
Expand Down

0 comments on commit a1e902f

Please sign in to comment.