With docker/buildx#1412 we now have provenance enabled by default (in-line mode): https://github.com/docker/buildx/blob/5f4d463780e72c643e3d24675a00e5c7bf50f1d5/build/build.go#L595
When building with Buildx master client (docker/buildx@5f4d463) using a container builder (BuildKit 01c0d67), the local exporter will create an extra platform directory in destination output which is unexpected and could break some workflows like:
$ git clone https://github.com/docker/buildx.git
$ cd buildx/
$ make install
...
#18 exporting to client directory
#18 copying files linux/amd64 21B
#18 copying files linux/amd64 49.18MB 0.3s done
#18 DONE 0.3s
mkdir -p ~/.docker/cli-plugins
install bin/build/buildx ~/.docker/cli-plugins/docker-buildx
install: cannot stat 'bin/build/buildx': No such file or directory
make: *** [Makefile:33: install] Error 1
$ tree bin/build
bin/build
└── linux_amd64
└── buildx
1 directory, 1 file
As provenance is in-line, it should just extract files in the expected dir.
Furthermore, when exporting without in-line enabled, I don't think we should create an extra platform directory:
$ tree bin/build
bin/build
└── linux_amd64
├── buildx
└── provenance.json
1 directory, 2 files
As it would still break some workflows. Instead we should keep the expected outcome and put extra attestation files in a specific directory like:
$ tree -a bin/build
bin/build
├── .buildkit-attest
│ └── provenance.json
└── buildx
1 directory, 2 files
Same when exporting for multi-platform:
$ tree -a bin/build
bin/build
├── linux_amd64
│ ├── .buildkit-attest
│ │ └── provenance.json
│ └── buildx
└── linux_arm64
├── .buildkit-attest
│ └── provenance.json
└── buildx
4 directories, 4 files
This way we avoid overriding exported files if someone wants to export a provenance.json file from build result. Concerning .buildkit-attest dir name I think it's fine but open to suggestions.
cc @tonistiigi @jedevc
With docker/buildx#1412 we now have provenance enabled by default (in-line mode): https://github.com/docker/buildx/blob/5f4d463780e72c643e3d24675a00e5c7bf50f1d5/build/build.go#L595
When building with Buildx master client (docker/buildx@5f4d463) using a container builder (BuildKit 01c0d67), the local exporter will create an extra platform directory in destination output which is unexpected and could break some workflows like:
As provenance is
in-line, it should just extract files in the expected dir.Furthermore, when exporting without
in-lineenabled, I don't think we should create an extra platform directory:As it would still break some workflows. Instead we should keep the expected outcome and put extra attestation files in a specific directory like:
Same when exporting for multi-platform:
This way we avoid overriding exported files if someone wants to export a
provenance.jsonfile from build result. Concerning.buildkit-attestdir name I think it's fine but open to suggestions.cc @tonistiigi @jedevc