tag the image with bip's NVR

This commit is contained in:
Vincent Batts 2019-03-07 15:00:55 -05:00
parent bc78eaaf6e
commit b5e8e23274
2 changed files with 14 additions and 2 deletions

View file

@ -14,7 +14,7 @@ RUN dnf update -y --refresh && \
RUN sed -i 's/^#ip/ip/' /etc/bip.conf && \
sed -i 's/^#port/port/' /etc/bip.conf
VOLUME /var/run/bip
VOLUME ["/var/run/bip"]
USER bip
EXPOSE 7778
ENV HOME=/var/run/bip

View file

@ -4,7 +4,18 @@ IMAGE ?= fedora
TAG ?= 29
.PHONY: image
image: .digest
image: .nvr
$(CTR) tag $(OUTPUT) $(OUTPUT):$(shell cat .nvr)
.PHONY: .nvr
.nvr: latest
$(CTR) run \
-it \
--rm \
$(OUTPUT) \
rpm -q bip | tee $@
latest: .digest
$(CTR) build \
--build-arg "IMAGE=$(IMAGE)" \
--build-arg "IMAGE_TAG=$(TAG)" \
@ -15,5 +26,6 @@ image: .digest
pull:
$(CTR) pull $(IMAGE):$(TAG)
.PHONY: .digest
.digest: pull
$(CTR) images --digests --format "{{.Digest}}" $(IMAGE):$(TAG) | head -1 | tee $@