jenkins-podman/Makefile

26 lines
627 B
Makefile
Raw Normal View History

2022-01-13 11:41:17 +00:00
VERSION ?= 0.1.0
BASE ?= latest-alpine-jdk11
REGISTRY := public.ecr.aws/zero-downtime
REPOSITORY := jenkins-podman
TAG := $(REPOSITORY):v$(VERSION)
.PHONY: build push clean
all: build
build:
podman build --rm --squash-all --build-arg BASE=$(BASE) -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:
podman rmi -f $(TAG)
scan:
podman save $(TAG) -o image.tar
trivy image --input image.tar --format template --template @./html.tpl -o report.html
rm -f image.tar