This repository builds a container image that combines the
kube-httpcache Kubernetes
controller with Varnish, using Varnish
9.1.0 by default.
The image is intended for deployments that need the kube-httpcache controller and exporter binaries from the upstream project while using a specific Varnish base image. The repository contains only the image assembly and its publishing workflow; Kubernetes manifests and cache configuration are managed by the consumer or by the upstream kube-httpcache project.
The multi-stage Dockerfile:
- Uses
quay.io/mittwald/kube-httpcache:stableas a build source. - Uses
varnish:9.1.0as the final runtime image. - Copies
/kube-httpcacheand/exporterfrom the upstream image. - Starts the container with
/kube-httpcacheas its entrypoint.
The upstream image and Varnish image can be overridden at build time:
docker build \
--build-arg KUBE_HTTPCACHE_IMAGE=quay.io/mittwald/kube-httpcache:stable \
--build-arg VARNISH_IMAGE=varnish:9.1.0 \
-t kube-httpcache-varnish:local .Run and configure the resulting image according to the kube-httpcache documentation and the requirements of the target Kubernetes deployment:
docker run --rm kube-httpcache-varnish:localThe command above is primarily a smoke test for image startup. A useful deployment normally supplies the controller's required Kubernetes access and Varnish/cache configuration through the surrounding deployment setup.
GitHub Actions builds and pushes the image to:
ghcr.io/serit/kube-httpcache-varnish
The workflow runs automatically when a tag beginning with v is pushed, and
can also be started manually. It publishes Linux amd64 images with both the
version tag and an immutable Git SHA tag.
To create a release image, push a version tag, for example:
git tag v9.1.0-2
git push origin v9.1.0-2The workflow requires permission to write GitHub Packages and uses the
workflow-provided GITHUB_TOKEN to authenticate to GHCR.
Dockerfile Image assembly definition
.github/workflows/docker.yml GitHub Actions build and publish workflow
Update the VARNISH_IMAGE default in Dockerfile when moving to a new Varnish
version. The upstream KUBE_HTTPCACHE_IMAGE can also be pinned or updated
there when a specific controller release is required. After changing either
base image, build locally and verify the resulting image before creating a
version tag.