This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
bip-box/Makefile

32 lines
551 B
Makefile
Raw Normal View History

2019-03-07 19:32:20 +00:00
OUTPUT ?= $(USER)/bip
CTR ?= podman
IMAGE ?= fedora
TAG ?= 29
.PHONY: image
2019-03-07 20:00:55 +00:00
image: .nvr
$(CTR) tag $(OUTPUT) $(OUTPUT):$(shell cat .nvr)
.PHONY: .nvr
.nvr: latest
$(CTR) run \
-it \
--rm \
$(OUTPUT) \
rpm -q bip | tee $@
latest: .digest
2019-03-07 19:32:20 +00:00
$(CTR) build \
--build-arg "IMAGE=$(IMAGE)" \
--build-arg "IMAGE_TAG=$(TAG)" \
--build-arg "DIGEST=$(shell cat .digest)" \
-t $(OUTPUT) \
.
pull:
$(CTR) pull $(IMAGE):$(TAG)
2019-03-07 20:00:55 +00:00
.PHONY: .digest
2019-03-07 19:32:20 +00:00
.digest: pull
$(CTR) images --digests --format "{{.Digest}}" $(IMAGE):$(TAG) | head -1 | tee $@