fix(handlers): handle Buildkit index as an OCI manifest when using the database
Related to #407 (closed).
This guarantees that Buildkit indexes are validated and stored as manifests on the DB (namely the config and layer relationships) while ensuring that their digest and payload are preserved and that they can be pulled without issues.
Pushing and pulling a buildkit cache image works just fine after this:
docker buildx build \
--cache-from=type=registry,ref=172.0.0.1:5000/buildx:cache \
--cache-to=type=registry,ref=172.0.0.1:5000/buildx:cache,mode=max \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-t 172.0.0.1:5000/buildx:image \
--push \
- <<<$(echo -e "FROM alpine:3.14.0\nRUN echo 'foo' > /foo")
database changes:
- Add new
non_conformant
(boolean) column tomanifests
table. Buildkit cache images do not conform with the OCI spec, so we have to process them in a different way. This column is used so that we can easily identify these non conformant manifests when needed; - Add new
application/vnd.buildkit.cacheconfig.v0
media type to known media types list inmedia_types
table.
Edited by João Pereira