Public | Automated Build

Last pushed: 2 months ago
Short Description
This image (based on Debian Jessie) runs Varnish 4.1.6 on port 81.
Full Description

Varnish 4 Docker image

This image (based on Debian Jessie) runs Varnish 4.1.6 on port 81.
varnishncsa and varnish-agent are also installed in the container.

How to run the container

You can run the container with the docker run command :

    docker run klabs/varnish41

But is is strongly recommended to use docker-compose with the script provided in ezdocker-stack repository.

How to use docker-compose to run container

First install docker-compose :

curl -L`uname -s`-`uname -m` > ~/bin/docker-compose
chmod +x ~/bin/docker-compose

Then run the container with the following command :

docker-compose up -d

If you wish to add more options to docker compose, you will have to create your own project.yml file which will extend the one present in this repository.
Here is an example :

  • Create a project.yml file in your home folder

  • Add the following lines in your yml file :

    file: /home/user/docker/varnish4/docker-compose.yml
    service: varnish4
  image: klabs/varnish41
   - /home/user/www/project/doc/varnish/vcl/config.vcl:/etc/varnish/default.vcl
   - web

This will start a varnish container with your project specific vcl file as Varnish default vcl, and link the Varnish container to your 'web' container (Apache)

  • Run docker-compose by specifying your own yml file :
docker-compose -f /path/to/project.yml -p my_project_name up -d
Docker Pull Command
Source Repository

Comments (0)