newsdev/docker-varnish

Name: docker-varnish

Owner: NYT Newsroom Developers

Description: null

Created: 2015-05-18 19:57:47.0

Updated: 2018-05-15 20:22:42.0

Pushed: 2016-06-15 21:23:40.0

Homepage: null

Size: 29

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Varnish

Supported tags and respective Dockerfile links
What is Varnish?

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture.

wikipedia.org/wiki/Varnish_(software)

How to use this image.

This image is intended as a base image for other images to built on.

Create a Dockerfile in your Varnish project
 newsdev/varnish:4.1.0
Create a default.vcl in your Varnish project
4.0;

end default {
.host = "www.nytimes.com";
.port = "80";

Then, run the commands to build and run the Docker image:

cker build -t my-varnish .
cker run -it --rm --name my-running-varnish my-varnish
Customize configuration

You can override the port Varnish serves in your Dockerfile.

 newsdev/varnish:4.1.0

VARNISH_PORT 8080
VARNISH_DAEMON_OPTS "additional varnish options here"
SE 8080

For valid VARNISH_DAEMON_OPTS, see the varnish options documentation.

You can override the size of the cache.

 newsdev/varnish:4.1.0

VARNISH_MEMORY 1G
How to install VMODs (Varnish Modules)

Varnish Modules are extensions written for Varnish Cache.

To install Varnish Modules, you will need the Varnish source to compile against. This is why we install Varnish from source in this image rather than using a package manager.

Install VMODs in your Varnish project's Dockerfile. For example, to install the Querystring module:

 newsdev/varnish:4.1.0

stall Querystring Varnish module
QUERYSTRING_VERSION=0.3
\
 /usr/local/src/ && \
rl -sfL https://github.com/Dridi/libvmod-querystring/archive/v$QUERYSTRING_VERSION.tar.gz -o libvmod-querystring-$QUERYSTRING_VERSION.tar.gz && \
r -xzf libvmod-querystring-$QUERYSTRING_VERSION.tar.gz && \
 libvmod-querystring-$QUERYSTRING_VERSION && \
autogen.sh && \
configure VARNISHSRC=/usr/local/src/varnish-$VARNISH_VERSION && \
ke install && \
 -r ../libvmod-querystring-$QUERYSTRING_VERSION*

License

View license information for the software contained in this image.

Supported Docker versions

This image is supported on Docker version 1.9.1.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

Issues

If you have any problems with or questions about this image, please contact us through a GitHub issue.

Contributing

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.