Skip to content

Commit

Permalink
Fix image builds (#6862)
Browse files Browse the repository at this point in the history
Docker recently introduced [provenance attestation](https://docs.docker.com/build/attestations/slsa-provenance/) in buildx 0.10.0, which broke our multi-arch image builds. By default, `docker buildx build` now defaults to `--provenance true` which causes even single-architecture images to be built as a manifest list (aka multi-arch image consisting of one architecture, according to this GitHub issue [comment](docker/buildx#1509 (comment))). When we use our older manifest-tool to create a manifest from three single-arch images (amd64, arm32v7, and arm64v8), the tool fails because it can't create a manifest list that points to other manifest lists.

To mitigate, we'll disable provenance attestation for now. In the future we should look at updating how we create our multi-arch images.

To test, I ran the CI build and end-to-end tests to confirm the images build successfully and function as expected.

## Azure IoT Edge PR checklist:
  • Loading branch information
damonbarry authored Jan 24, 2023
1 parent 80c5e46 commit f82a7d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/linux/buildImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,18 @@ docker_build_and_tag_and_push() {
build_context=$(gnarly --mod-config $SOURCE_MAP $dockerfile)
fi

# When Docker introduced provenance attestation in buildx 0.10.0 it broke
# our multi-arch image builds. By default, `buildx build` now defaults to
# `--provenance true` which causes even single-architecture images to be
# built as a manifest list (aka multi-arch image). When we use our older
# manifest-tool to create a manifest from three single-arch images (amd64,
# arm32v7, and arm64v8), the tool fails because it can't create a manifest
# list that points to other manifest lists. To mitigate, we'll disable
# provenance attestation for now.
docker buildx build \
--no-cache \
--platform $platform \
--provenance false \
--build-arg 'EXE_DIR=.' \
--file $dockerfile \
--output=$attrs,name=$image,buildinfo-attrs=true \
Expand Down

0 comments on commit f82a7d9

Please sign in to comment.