From b5e8e2327487b6cdc23696650cf35a1b3e0c7617 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 7 Mar 2019 15:00:55 -0500 Subject: [PATCH] tag the image with bip's NVR --- Dockerfile | 2 +- Makefile | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 243fb61..20d39f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index e5ac5b8..38d5b3f 100644 --- a/Makefile +++ b/Makefile @@ -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 $@