1 ##############################################################################
2 # Copyright (c) 2019 AT&T, ENEA AB, Nokia and others #
4 # Licensed under the Apache License, Version 2.0 (the "License"); #
5 # you maynot use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
10 # Unless required by applicable law or agreed to in writing, software #
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT #
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
13 # See the License for the specific language governing permissions and #
14 # limitations under the License. #
15 ##############################################################################
18 # declare the variables
21 TAG_PRE ?= $(notdir $(CURDIR))
23 DOCKERFILE ?= Dockerfile
24 MTOOL ?= $(dir $(realpath $(lastword $(MAKEFILE_LIST))))/manifest-tool
26 # get the architecture of the host
28 ifeq ($(shell uname -m), aarch64)
33 wget https://github.com/estesp/manifest-tool/releases/download/v0.9.0/manifest-tool-linux-$(HOST_ARCH) -O $@
39 -t $(REGISTRY)/$(NAME):$(TAG_PRE)-$(HOST_ARCH)-$(TAG_VER) \
45 docker push $(REGISTRY)/$(NAME):$(TAG_PRE)-$(HOST_ARCH)-$(TAG_VER)
47 .PHONY: .push_manifest
48 .push_manifest: $(MTOOL)
49 $(MTOOL) push from-args \
50 --platforms linux/amd64,linux/arm64 \
51 --template $(REGISTRY)/$(NAME):$(TAG_PRE)-ARCH-$(TAG_VER) \
52 --target $(REGISTRY)/$(NAME):$(TAG_PRE)-$(TAG_VER)