varnish/root/help.1
2017-09-05 14:51:07 +02:00

135 lines
3.2 KiB
Groff

.TH "VARNISH " "1" " Container Image Pages" "Jan Koscielniak" "June 20, 2017"
.nh
.ad l
.SH NAME
.PP
varnish \- HTTP accelerator designed for content\-heavy dynamic web sites
.SH DESCRIPTION
.PP
This container image provides the varnish HTTP reverse proxy. It uses Fedora 26 as a base image.
.PP
Varnish secret file is generated each time the container is built, for better security. While this provides \fIsome\fP security, we strongly advise you always use your own secret (see below) or do not expose $MANAGEMENT\_PORT if you don't need it.
.SH USAGE
.PP
You can run this image in docker like this:
.PP
.RS
.nf
# docker run \-p $PORT:6081
.fi
.RE
.PP
This is the basic execution of the container. $PORT is the port of the varnish frontend on which it will serve content. Varnish has it's own admin CLI (see $MANAGEMENT\_PORT below). To access it, you'll need the varnish secret file. Please refer to varnish documentation on how to generate it. You can mount your secret file, that has to be named varnish\_secret like this:
.PP
.RS
.nf
# docker run \-p $PORT:6081 \-p $MANAGEMENT\_PORT:6082 \-v $SECRET\_DIR:/varnish\_secret/
.fi
.RE
.PP
If that gives you an error, it might be due to SELinux, you can then apply the following:
.PP
.RS
.nf
# chcon \-Rt svirt\_sandbox\_file\_t $SECRET\_DIR
.fi
.RE
.PP
If you want to use your configuration instead of the default one, name it default.vcl and mount it like this:
.PP
.RS
.nf
# docker run \-p $PORT:6081 \-v $CONFIG\_DIR:/varnish\_config/
.fi
.RE
.PP
Where $CONFIG\_DIR is a directory that contains default.vcl file.
.PP
You can also link containers which you can use as backend servers. You need to run the container you want to use as backend, get it's name or hash, and then edit the configuration file with a hostname you choose for the container. Then run it like this:
.PP
.RS
.nf
# docker run \-p $PORT:6081 \-\-link container\_name:hostname
.fi
.RE
.PP
Image can also be run in Openshift. You can obtain the template in the repository of this image \-
\[la]https://github.com/container-images/nginx\[ra]\&. You also need to have SCC RunAsUser set to RunAsAny. Then run:
.PP
.RS
.nf
# oc create \-f openshift\-template.yml
.fi
.RE
.SH ENVIRONMENT VARIABLES
.PP
There are no environment variables to be set.
.SH SECURITY IMPLICATIONS
.PP
\-p $PORT:6081
Exposes port 6081 on the container and forwards it to $PORT on the host. This is the varnish frontend.
.PP
\-p $MANAGEMENT\_PORT:6082
Exposes port 6082 on the container and forwards it to $MANAGEMENT\_PORT on the host. This is varnish admin CLI.
.PP
\-v $SECRET\_DIR:/varnish/
Mounts a directory with varnish\_secret file, that is used for securing the admin CLI.
.PP
\-v $CONFIG\_DIR:/varnish\_config/
Mounts a directory with default.vcl file, which is a configuration file for varnish.
.PP
\-\-link container\_name:hostname
Links another running container and assigns it a hostname. That hostname is used in varnish config to identify the container as a backend server
.PP
This container runs as root user.
.SH HISTORY
.PP
Similar to a Changelog of sorts which can be as detailed as the maintainer wishes.
.SH SEE ALSO
.PP
Github page for this container with detailed description:
\[la]https://github.com/container-images/varnish\[ra]