make this an oci container, not nspawn

This commit is contained in:
Vincent Batts 2019-03-07 14:32:20 -05:00
parent e41a2e81ae
commit 1d5dc44ed3
2 changed files with 40 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
ARG IMAGE=fedora
ARG IMAGE_TAG=29
FROM ${IMAGE}:${IMAGE_TAG}
LABEL com.hashbangbash.image=${IMAGE}:${IMAGE_TAG}@${DIGEST}
LABEL com.hashbangbash.image.repo=${IMAGE}
LABEL com.hashbangbash.image.tag=${IMAGE_TAG}
LABEL com.hashbangbash.image.digest=${DIGEST}
RUN dnf update -y --refresh && \
dnf install -y bip && \
dnf clean all
RUN sed -i 's/^#ip/ip/' /etc/bip.conf && \
sed -i 's/^#port/port/' /etc/bip.conf
VOLUME /var/run/bip
USER bip
EXPOSE 7778
ENV HOME=/var/run/bip
CMD ["/usr/bin/bip", "-n", "-f", "/etc/bip.conf"]

19
Makefile Normal file
View File

@ -0,0 +1,19 @@
OUTPUT ?= $(USER)/bip
CTR ?= podman
IMAGE ?= fedora
TAG ?= 29
.PHONY: image
image: .digest
$(CTR) build \
--build-arg "IMAGE=$(IMAGE)" \
--build-arg "IMAGE_TAG=$(TAG)" \
--build-arg "DIGEST=$(shell cat .digest)" \
-t $(OUTPUT) \
.
pull:
$(CTR) pull $(IMAGE):$(TAG)
.digest: pull
$(CTR) images --digests --format "{{.Digest}}" $(IMAGE):$(TAG) | head -1 | tee $@