Skip to content

Commit

Permalink
Ensure image OCI compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
torredil committed Apr 11, 2022
1 parent 355bb34 commit 5ef82a9
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ all: all-image-docker
all-push: all-image-registry push-manifest

.PHONY: push-manifest
push-manifest: create-manifest all-annotate-manifest
push-manifest: create-manifest
docker manifest push --purge $(IMAGE):$(TAG)

.PHONY: create-manifest
Expand All @@ -81,17 +81,6 @@ create-manifest:
# RHS: replace with $(IMAGE):$(TAG)-& where & is what was matched on LHS
docker manifest create --amend $(IMAGE):$(TAG) $(shell echo $(ALL_OS_ARCH_OSVERSION) | sed -e "s~[^ ]*~$(IMAGE):$(TAG)\-&~g")

.PHONY: all-annotate-manifest
all-annotate-manifest: $(addprefix sub-annotate-manifest-,$(ALL_OS_ARCH_OSVERSION))

sub-annotate-manifest-%:
$(MAKE) OS=$(call word-hyphen,$*,1) ARCH=$(call word-hyphen,$*,2) OSVERSION=$(call word-hyphen,$*,3) annotate-manifest

.PHONY: annotate-manifest
annotate-manifest: .annotate-manifest-$(OS)-$(ARCH)-$(OSVERSION)
.annotate-manifest-$(OS)-$(ARCH)-$(OSVERSION):
set -x; docker manifest annotate --os $(OS) --arch $(ARCH) --os-version $(OSVERSION) $(IMAGE):$(TAG) $(IMAGE):$(TAG)-$(OS)-$(ARCH)-$(OSVERSION)

# Only linux for OUTPUT_TYPE=docker because windows image cannot be exported
# "Currently, multi-platform images cannot be exported with the docker export type. The most common usecase for multi-platform images is to directly push to a registry (see registry)."
# https://docs.docker.com/engine/reference/commandline/buildx_build/#output
Expand Down

0 comments on commit 5ef82a9

Please sign in to comment.