Commit faf6b48e authored by Geoff Simmons's avatar Geoff Simmons

Unify the build for the "varnish point release" and klarlack containers.

Both are now obtained from the repo at pkg.uplex.de, and differ only
in:
- the version, dist and pool parameters of the source repo, as
  expressed in /etc/apt/sources.list, and
- the list of VMODs to install.

We now have one Dockerfile for the two containers, and the four
parameters listed above are passed into the build as build-args,
using values set in the Makefile.

This also has the effect of changing the base image for klarlack
to Debian slim, updated to the currently most recent version.

The Dockerfile is now simpler than the previous version for
klarlack, in that we set the version once in the repo path, rather
than specify "=${VERSION}" for Varnish and each VMOD in the
apt install invocation.
parent 6f05edd1
FROM debian:bookworm-20240311
ENV VERSION=20240128+bookworm
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl gnupg coreutils procps
# add uplex repository and import gpg key
RUN echo "deb https://pkg.uplex.de/dpkg bookworm klarlack" | tee -a /etc/apt/sources.list
RUN curl -L https://pkg.uplex.de/dpkg/uplex-varnish.gpg.key | apt-key add -
RUN apt-get clean && \
apt-get update
RUN apt-get install -y varnish=${VERSION} \
libvdfp-pipe=${VERSION} \
libvfp-brotli=${VERSION} \
libvmod-all-healthy=${VERSION} \
libvmod-blobdigest=${VERSION} \
libvmod-blobsynth=${VERSION} \
libvmod-cluster=${VERSION} \
libvmod-crypto=${VERSION} \
libvmod-dispatch=${VERSION} \
libvmod-dns=${VERSION} \
libvmod-dynamic=${VERSION} \
libvmod-frozen=${VERSION} \
libvmod-geoip2=${VERSION} \
libvmod-hoailona=${VERSION} \
libvmod-iconv=${VERSION} \
libvmod-j=${VERSION} \
libvmod-querystring=${VERSION} \
libvmod-re2=${VERSION} \
libvmod-re=${VERSION} \
libvmod-selector=${VERSION} \
libvmod-tus=${VERSION} \
libvmod-xcounter=${VERSION} \
libvmod-zipflow=${VERSION} \
varnish-modules=${VERSION} \
varnish-objvar=${VERSION}
RUN apt-get remove -y -q curl gnupg && \
apt-get autoremove -y -q && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /usr/share/doc && \
rm -rf /usr/share/man
# Set the varnish GID to 998 as in the packagecloud install.
RUN /bin/mkdir /run/varnish && \
/usr/sbin/groupmod -g 998 varnish
COPY bogo_backend.vcl /etc/varnish/
COPY ok.vcl /etc/varnish/
COPY notavailable.vcl /etc/varnish
COPY boot.vcl /etc/varnish
COPY start.cli /etc/varnish
COPY varnishd_exec.sh /
RUN /bin/chmod 755 /varnishd_exec.sh /etc/varnish
ENV HTTP_PORT=8888 PROTO=HTTP READY_PORT=8080 SECRET_PATH=/var/run/varnish \
SECRET_FILE=_.secret ADMIN_PORT=6081 GROUP=varnish \
OFFLOAD_PATH=/var/run/offload/varnish.sock CONFIG_PORT=8000
ENTRYPOINT ["/varnishd_exec.sh"]
FROM debian:bookworm-20240408-slim
ENV VERSION=20240307
ENV DIST=bookworm-varnish
ENV POOL=varnish
ARG VERSION
ARG DIST
ARG POOL
ARG VMODS
RUN apt-get update && \
apt-get upgrade -y && \
......@@ -13,12 +14,7 @@ RUN curl -L https://pkg.uplex.de/dpkg/uplex-varnish.gpg.key | apt-key add -
RUN apt-get clean && \
apt-get update
RUN apt-get install -y varnish \
libvmod-re2 \
libvmod-selector \
libvmod-dynamic \
libvmod-blobdigest \
varnish-objvar
RUN apt-get install -y varnish ${VMODS}
RUN apt-get remove -y -q curl gnupg && \
apt-get autoremove -y -q && \
......
......@@ -41,17 +41,44 @@ ifeq ($(MINKUBE),1)
eval $(minikube docker-env)
endif
VARNISH_VERSION=20240307
VARNISH_DIST=bookworm-varnish
VARNISH_POOL=varnish
VARNISH_VMODS=libvmod-re2 libvmod-selector libvmod-dynamic libvmod-blobdigest \
varnish-objvar
KLARLACK_VERSION=20240128
KLARLACK_DIST=bookworm
KLARLACK_POOL=klarlack
KLARLACK_VMODS=libvdfp-pipe libvfp-brotli libvmod-all-healthy \
libvmod-blobdigest libvmod-blobsynth libvmod-cluster libvmod-crypto \
libvmod-dispatch libvmod-dns libvmod-dynamic libvmod-frozen \
libvmod-geoip2 libvmod-hoailona libvmod-iconv libvmod-j \
libvmod-querystring libvmod-re2 libvmod-re libvmod-selector \
libvmod-tus libvmod-xcounter libvmod-zipflow varnish-modules \
varnish-objvar
controller: Dockerfile.controller docker-minikube
docker build $(DOCKER_BUILD_OPTIONS) -t $(IMAGE_REPO)varnish-ingress/controller \
-f Dockerfile.controller ..
varnish: Dockerfile.varnish docker-minikube
docker build $(DOCKER_BUILD_OPTIONS) -t $(IMAGE_REPO)varnish-ingress/varnish \
docker build $(DOCKER_BUILD_OPTIONS) \
--build-arg VERSION=$(VARNISH_VERSION) \
--build-arg DIST=$(VARNISH_DIST) \
--build-arg POOL=$(VARNISH_POOL) \
--build-arg VMODS="$(VARNISH_VMODS)" \
-t $(IMAGE_REPO)varnish-ingress/varnish \
-f Dockerfile.varnish .
klarlack: Dockerfile.klarlack docker-minikube
docker build $(DOCKER_BUILD_OPTIONS) -t $(IMAGE_REPO)varnish-ingress/klarlack \
-f Dockerfile.klarlack .
klarlack: Dockerfile.varnish docker-minikube
docker build $(DOCKER_BUILD_OPTIONS) \
--build-arg VERSION=$(KLARLACK_VERSION) \
--build-arg DIST=$(KLARLACK_DIST) \
--build-arg POOL=$(KLARLACK_POOL) \
--build-arg VMODS="$(KLARLACK_VMODS)" \
-t $(IMAGE_REPO)varnish-ingress/klarlack \
-f Dockerfile.varnish .
ascn: Dockerfile.ascn docker-minikube
docker build $(DOCKER_BUILD_OPTIONS) -t $(IMAGE_REPO)varnish-ingress/ascn \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment