@@ -20,7 +20,7 @@ PKG_PATH := /go/src/$(PKG_NAME)
2020
2121
2222CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(BUILD_TAG )
23- CNAB_BASE_INVOCATION_IMAGE_PATH := _build/invocation-image.tar
23+ CNAB_BASE_INVOCATION_IMAGE_PATH := _build/invocation-image
2424
2525PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME := docker/cnab-app-base:$(TAG )
2626
@@ -121,21 +121,36 @@ specification/bindata.go: specification/schemas/*.json build_dev_image
121121schemas : specification/bindata.go # # generate specification/bindata.go from json schemas
122122
123123invocation-image :
124- docker build -f Dockerfile.invocation-image $(BUILD_ARGS ) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) .
124+ docker build -f Dockerfile.invocation-image $(BUILD_ARGS ) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -amd64 --platform=amd64 .
125+
126+ invocation-image-arm64 :
127+ docker build -f Dockerfile.invocation-image $(BUILD_ARGS ) --target=invocation -t $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -arm64 --platform=arm64 .
128+
129+ invocation-image-cross : invocation-image invocation-image-arm64
125130
126131save-invocation-image-tag :
127132 docker tag $(CNAB_BASE_INVOCATION_IMAGE_NAME ) docker/cnab-app-base:$(INVOCATION_IMAGE_TAG )
128133 docker save docker/cnab-app-base:$(INVOCATION_IMAGE_TAG ) -o _build/$(OUTPUT )
129134
130- save-invocation-image : invocation-image
135+ save-invocation-image :
131136 @$(call mkdir,_build)
132- docker save $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -o $(CNAB_BASE_INVOCATION_IMAGE_PATH )
137+ docker save $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -o $(CNAB_BASE_INVOCATION_IMAGE_PATH ) .tar
138+
139+ save-invocation-image-cross : save-invocation-image
140+ docker save $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -arm64 -o $(CNAB_BASE_INVOCATION_IMAGE_PATH ) -arm64.tar
133141
134142push-invocation-image :
143+ # tag and push linux/amd64
135144 docker tag $(CNAB_BASE_INVOCATION_IMAGE_NAME ) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME )
136145 docker push $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME )
146+ # tag and push linux/arm64
147+ docker tag $(CNAB_BASE_INVOCATION_IMAGE_NAME ) -arm64 $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME ) -arm64
148+ docker push $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME ) -arm64
149+ # create and push manifest list
150+ docker manifest create $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME ) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME ) $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME ) -arm64
151+ docker manifest push $(PUSH_CNAB_BASE_INVOCATION_IMAGE_NAME )
137152
138153help : # # this help
139154 @awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST ) | sort
140155
141- .PHONY : lint test-e2e test-unit test cli-cross cross e2e-cross coverage coverage-run coverage-results shell build_dev_image tars vendor check-vendor schemas help invocation-image save-invocation-image save-invocation-image-tag push-invocation-image
156+ .PHONY : lint test-e2e test-unit test cli-cross cross e2e-cross coverage coverage-run coverage-results shell build_dev_image tars vendor check-vendor schemas help invocation-image invocation-image-arm64 invocation-image-cross save-invocation-image save-invocation-image-tag push-invocation-image
0 commit comments