Varnish docker image with support for dynamic backends, Rancher DNS, auto-configure and reload.
1M+
Varnish docker image with support for dynamic backends, Rancher DNS, auto-configure and reload.
This image is generic, thus you can obviously re-use it within your non-related EEA projects.
:7 Dockerfile (Alpine 3.22, Varnish 7.7.3):8 Dockerfile (Alpine 3.23, Varnish 8.0.2):9 Dockerfile (Alpine 3.23, Varnish 9.0.3):4.1-6.5 Dockerfile - Varnish: 4.1.11 Release: 6.5:7.2-1.0 Dockerfile - Varnish: 7.2 Release: 1.0:7.4-1.1 Dockerfile - Varnish: 7.4.2 Release: 1.1:7.5-1.0 Dockerfile - Varnish: 7.5.0 Release: 1.0:7.6-1.0 Dockerfile - Varnish: 7.6.1 Release: 1.0:7.7-1.1 Dockerfile - Varnish: 7.7.3 Release: 1.1:8.0-1.1 Dockerfile - Varnish: 8.0.2 Release: 1.1See older versions
VARNISH_HTTP_PORT - varnish portVARNISH_HTTPS_PORT - varnish ssl portVARNISH_SIZE - varnish cache sizeAUTOKILL_CRON - Varnish re-create crontab, will force a recreation of the container. Uses UTC time, format is linux crontab - for example - 0 2 * * * is 02:00 UTC each day"VARNISH_CFG_CONTENT - Multiline variable that will be written in the default.vcl fileVARNISH_CFG_CONTENTSee docker-compose.yml.
The default.vcl file provided with this image is bare and only contains
the marker to specify the VCL version. If you plan on using a more
elaborate base configuration in your container and you want it shipped with
your image, you can extend the image in a Dockerfile, like this:
FROM eeacms/varnish
COPY varnish.vcl /etc/varnish/default.vcl
and then run
$ docker build -t varnish-custom /path/to/Dockerfile
Choose relevant variable name, starting with VARNISH_ - eg. VARNISH_EXAMPLE
Add default value in Dockerfile
ENV VARNISH_EXAMPLE="GET"
Add variable in <> in varnish.vcl
set req.http.X-Varnish-Routed = "<VARNISH_EXAMPLE>";
Add description in Readme.md
/varnish-configThe volume /varnish-config will be used to store the read only vcl template configuration files. They will be copied with the same structure to /etc/varnish, where the variable substitution will be done.
Use dynamic.director to integrate varnish in rancher DNS - if a backend containers are changed, it knows to get the latest list of IPs automatically.
new cluster = dynamic.director(port = "<VARNISH_BACKEND_PORT>", ttl = <VARNISH_DNS_TTL>);
You can use plone-varnish as an example of usage.
$ docker pull eeacms/varnish
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
The Original Code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Content type
Image
Digest
sha256:b6d5b79cd…
Size
91.4 MB
Last updated
3 months ago
docker pull eeacms/varnish