Public Repository

Last pushed: 12 days ago
Short Description
Platform for running Varnish or building Varnish-based application
Full Description

Varnish Cache 4.0 HTTP reverse proxy container image

This container image includes Varnish 4.0 Cache server and a reverse proxy for OpenShift and general usage.
Users can choose between RHEL and CentOS based images.
The RHEL image is available in the Red Hat Container Catalog
The CentOS image is then available on Docker Hub
as centos/varnish-4-centos7.


Varnish available as container is a base platform for
running Varnish server or building Varnish-based application.
Varnish Cache stores web pages in memory so web servers don't have to create
the same web page over and over again. Varnish Cache serves pages much faster
than any application server, giving the website a significant speed up.

The image can be used as a base image for other applications based on Varnish Cache 4.0 or using s2i tool.


To build a simple sample-app application
using standalone S2I and then run the
resulting image with Docker execute:

  • For RHEL based image

     $ docker pull
     $ s2i build --context-dir=4/test/test-app/ sample-server
     $ docker run -p 8080:8080 sample-server
  • For CentOS based image

     $ docker pull centos/varnish-4-centos7
     $ s2i build --context-dir=4/test/test-app/ centos/varnish-4-centos7 sample-server
     $ docker run -p 8080:8080 sample-server

Accessing the application:

$ curl


No further configuration is required.

S2I build support

The Varnish Cache 4.0 container image supports the S2I tool (see Usage section).
Note that the default.vcl configuration file in the directory accessed by S2I needs
to be in the VCL format.

Environment variables and volumes

No special environment variables or volumes available.


Varnish logs into standard output, so the log is available in the container log. The log can be examined by running:

docker logs <container>

See also

Dockerfile and other sources for this container image are available on
In that repository, Dockerfile for CentOS is called Dockerfile, Dockerfile
for RHEL is called Dockerfile.rhel7.

Docker Pull Command