Skip to content

Commit

Permalink
apps: Enable OCI image format
Browse files Browse the repository at this point in the history
Add ability to enable building images in the OCI format for a factory.
By default, the docker format is applied as it is now. To enable the OCI
format the `ENABLE_OCI_IMAGES` should be set to "1".

The Docker format is gradually becoming obsolete, with most advancements
now focused on the OCI image format. This change enables us to perform
end-to-end testing of OCI image format support.
After that, we can offer our customers the option to transition to the new
format and take advantage of its enhanced capabilities, such as
switching to zstd compression.

Signed-off-by: Mike Sul <[email protected]>
  • Loading branch information
mike-sul committed Oct 1, 2024
1 parent b877a98 commit d85c225
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,16 @@ for x in $IMAGES ; do
docker_cmd="$docker_cmd --no-cache"
fi

enable_oci=false
if [ "${ENABLE_OCI_IMAGES}" == "1" ] ; then
enable_oci=true
fi

# Load built images into the local docker store and push them to registry if the buildx and buildkit
# supports multiple outputs in the `build` command.
# Consider removing the "if" condition once all customers are moved to the newer versions of buildkit/buildx.
if compare_versions "v0.13.1" "${BUILDX_VERSION}" && compare_versions "v0.13.1" "${BUILDKIT_VERSION}"; then
docker_cmd="$docker_cmd --load --output=type=registry,oci-mediatypes=false --provenance=false --cache-to type=registry,ref=${ct_base}:${LATEST}-${ARCH}_cache,mode=max"
docker_cmd="$docker_cmd --load --output=type=registry,oci-mediatypes=${enable_oci} --provenance=false --cache-to type=registry,ref=${ct_base}:${LATEST}-${ARCH}_cache,mode=max"
else
docker_cmd="$docker_cmd --push --cache-to type=registry,ref=${ct_base}:${LATEST}-${ARCH}_cache,mode=max"
fi
Expand Down

0 comments on commit d85c225

Please sign in to comment.