Sign inSign up

cs2ag/docker-varnish

By cs2ag

•Updated about 1 month ago

A Docker container with Varnish 4.x built on top of Debian 8

Image
0

1M+

cs2ag/docker-varnish repository overview

⁠Varnish 8.0 Docker container

A Docker container with Varnish 8.0 built on top of Debian 12

⁠Varnish 8.0 Docker container

Debian 12

Varnish 8.0

⁠Usage

You'll need a custom vcl file and a Varnish secret file to use this container. You can either (re)build the image with those files or you can mount a host directory when running the container.

⁠Build

docker build -t v8.0 . 

docker run -d \
  -v ./:/etc/varnish \
  --env 'VARNISH_PARAMS=-p pipe_timeout=1440 -p syslog_cli_traffic=off -p feature=+esi_ignore_https' \
  --env 'VARNISH_STORAGE=malloc,1G' \
  --name cs2agvarnish \
  -p 8080:80 \
  -p 8081:6082 \
  varnish:v8.0

⁠Environmental variables

You can configure Varnish daemon by passing following environment variables with docker run command:

VARNISH_PARAMS -p pipe_timeout=1440 -p syslog_cli_traffic=off -p feature=+esi_ignore_https
VARNISH_STORAGE malloc,1G

⁠Mounting host directory

You can mount a host directory which contains at least the vcl and the secrect file. The files must have the following names:

default.vcl

secret

-v /srv/www/varnish_config:/etc/varnish

⁠Exposing ports

The following ports can be exposed in order to use Varnish on container host:

80 Varnish port 6082 Varnish admin port

⁠Reload varnish vcl file

docker container exec CONTAINER_NAME '/usr/sbin/varnishreload'

⁠Author

([email protected]⁠)


Tag summary

Content type

Image

Digest

sha256:e45a9ab26…

Size

176.3 MB

Last updated

about 1 month ago

docker pull cs2ag/docker-varnish