2022-01-24 12:37:23 +00:00
|
|
|
VERSION ?= 1.21.9
|
2021-11-27 13:02:23 +00:00
|
|
|
ALPINE_VERSION ?= 3.15
|
|
|
|
REGISTRY := public.ecr.aws/zero-downtime
|
|
|
|
REPOSITORY := kubezero-admin
|
|
|
|
TAG := $(REPOSITORY):v$(VERSION)
|
|
|
|
KUBE_VERSION := $(shell echo $(VERSION) | sed -e 's/\.[[:digit:]]*$$//')
|
|
|
|
|
|
|
|
.PHONY: build push clean scan
|
|
|
|
|
2021-12-15 22:19:15 +00:00
|
|
|
all: build push
|
2021-11-27 13:02:23 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
podman build --rm --squash-all --build-arg KUBE_VERSION=$(KUBE_VERSION) --build-arg ALPINE_VERSION=$(ALPINE_VERSION) -t $(TAG) .
|
|
|
|
|
|
|
|
push:
|
|
|
|
aws ecr-public get-login-password --region us-east-1 | podman login --username AWS --password-stdin $(REGISTRY)
|
|
|
|
podman tag $(TAG) $(REGISTRY)/$(TAG)
|
|
|
|
podman push $(REGISTRY)/$(TAG)
|
|
|
|
|
|
|
|
clean:
|
2021-12-15 22:19:15 +00:00
|
|
|
podman image prune -f
|
2021-11-27 13:02:23 +00:00
|
|
|
|
|
|
|
scan:
|
|
|
|
podman system service&
|
|
|
|
sleep 5; trivy $(TAG)
|