Refactor build of docker images

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-06-01 21:22:32 -04:00
parent 8e2eebb197
commit ea8e711d2c
21 changed files with 89 additions and 183 deletions

View file

@ -17,28 +17,13 @@
# Use the 0.0 tag for testing, it shouldn't clobber any release builds
TAG ?= 0.0
HOSTARCH := $(shell uname -m | sed -e s/x86_64/amd64/ \
-e s/s390x/s390x/ \
-e s/armv7l/arm/ \
-e s/aarch64.*/arm64/)
ifndef ARCH
ARCH := $(HOSTARCH)
endif
ifeq ($(ARCH),)
$(error mandatory variable ARCH is empty)
endif
REGISTRY ?= ingress-controller
IMAGE = $(REGISTRY)/echo
image:
docker buildx build \
--load \
--progress plain \
--platform $(ARCH) \
-t $(IMAGE):$(TAG) .
docker build \
-t $(IMAGE):$(TAG) rootfs
clean:
docker rmi -f $(IMAGE):$(TAG) || true