Public | Automated Build

Last pushed: 14 days ago
Short Description
Varnish 4.x on top of CentOS-7, highly customisable (.vcl config, varnishd params)
Full Description

Varnish Docker container

Centos 7
Varnish 4.x

Usage

To use this container, you will need to provide your custom config.vcl (which is usually the case).

docker run -d \
  --link web-app:backend-host \
  --volumes-from web-app \
  --env 'VCL_CONFIG=/data/path/to/varnish.vcl' \
  million12/varnish

In the above example we assume that:

  • You have your application running inside web-app container and web server there is running on port 80 (although you don't need to expose that port, as we use --link and varnish will connect directly to it)
  • web-app container has /data volume with varnish.vcl somewhere there
  • web-app is aliased inside varnish container as backend-host
  • Your varnish.vcl should contain at least backend definition like this:
    backend default {
      .host = "backend-host";
      .port = "80";
    }
    

Environmental variables

You can configure Varnish daemon by following env variables:

VCL_CONFIG /etc/varnish/default.vcl
CACHE_SIZE 64m
VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600

Author(s)


Sponsored by Typostrap.io - the new prototyping tool for building highly-interactive prototypes of your website or web app. Built on top of TYPO3 Neos CMS and Zurb Foundation framework.

Docker Pull Command
Owner
million12
Source Repository

Comments (6)
shru
5 months ago

。・::・゚★PLEASE・::・゚☆ MAKING (・ω・)/ SOME 。・::・゚★TAGS・::・゚☆

tomaszglinski
6 months ago

Hi, I cannot reload VCL with varnihs predefined script:

[root@07e47f230a88 /]# varnish_reload_vcl
Connection failed (127.0.0.1:6082)
Unable to run varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 vcl.list

jvanbuskirk
7 months ago

I would also like to see tags as well :)

supernic0las
10 months ago

Please kindly add tags.

seeruk
a year ago

As bargenson has said, can you please add some tags to this image. It'd be great to know I'd still be using v4.x if a v5.x is ever released!

bargenson
2 years ago

Please provide some tags! I need to be sure the image I'm using doesn't change.

Thank you :-)