Search
Docker

Public Varnish Enterprise images

If you just wish to try out Varnish Enterprise, or if your account requires a license file, the easiest way to open a Varnish Enterprise image is using the varnish/enterprise image on the Docker Hub:

# docker is obviously a required
docker pull varnish/enterprise

If you’d like to contribute, you can check out the source code to build the container on github.

Running the image

You can then run the image:

# simply run it with the default configuration
docker run -p 8080:80 varnish/enterprise

# using a different VCL and license
docker run -p 8080:80 -v /tmp/default.vcl:/etc/varnish/default.vcl -v /tmp/varnish-enterprise.lic:/etc/varnish/varnish-enterprise.lic varnish/enterprise

# if the first argument starts with a "-", all the arguments are appended to the default varnishd command
docker run -p 8080:8080 varnish/enterprise -a :8080 -p default_ttl=90

# otherwise the arguments are understood as a command to run instead of varnishd:
docker run varnish/enterprise echo "Hello, World!"

Environment variables

Some parameteres can be modified at runtime using environment variables. Some of these may requiring a more extensive license than the one bundled in the container, they are marked with a * in the list below:

  • VARNISH_STORAGE_BACKEND (malloc): dictate which caching storage to use (passed to the -s argument). Can be either malloc or mse4
  • VARNISH_SIZE (depends): how big should hte cache be
    • if VARNISH_STORAGE_BACKEND=malloc, defaults to 100MB
    • if VARNISH_STORAGE_BACKEND=mse4, default to 80%, using memory_governor
  • VARNISH_VCL_FILE (etc/varnish/default.vcl): which VCL file to load
  • VARNISH_HTTP_PORT (80): which port to listen on for HTTP traffic
  • VARNISH_PROXY_PORT (8444): which port to listen on for PROXY traffic
  • MSE4_CONFIG*: path to an mse4 configuraiton file, implies VARNISH_STORAGE_BACKEND=mse4
  • MSE4_CACHE_FORCE_PRESERVE*: when calling mkfs.mse4 (if MSE4_CONFIG is set), use the -f switch

Note that the images also defines the VMOD_DEPS that contains required packages to compile C vmods.


®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203