Skip to content

Commit 04179ce

Browse files
committed
[varnish] adjust the tmpfs directory for permission reasons
1 parent 92295e3 commit 04179ce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

varnish/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Then run:
7676
```console
7777
# we need both a configuration file at /etc/varnish/default.vcl
7878
# and our workdir to be mounted as tmpfs to avoid disk I/O
79-
$ docker run -v /path/to/default.vcl:/etc/varnish/default.vcl:ro --tmpfs /var/lib/varnish:exec varnish
79+
$ docker run -v /path/to/default.vcl:/etc/varnish/default.vcl:ro --tmpfs /var/lib/varnish/varnishd:exec varnish
8080
```
8181

8282
Alternatively, a simple `Dockerfile` can be used to generate a new image that includes the necessary `default.vcl` (which is a much cleaner solution than the bind mount above):
@@ -90,7 +90,7 @@ COPY default.vcl /etc/varnish/
9090
Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
9191

9292
```console
93-
$ docker --tmpfs /var/lib/varnish:exec my-varnish
93+
$ docker --tmpfs /var/lib/varnish/varnishd:exec my-varnish
9494
```
9595

9696
## Reloading the configuration
@@ -115,14 +115,14 @@ docker run varnish varnishreload -h
115115
By default, the containers will use a cache size of 100MB, which is usually a bit too small, but you can quickly set it through the `VARNISH_SIZE` environment variable:
116116

117117
```console
118-
$ docker run --tmpfs /var/lib/varnish:exec -e VARNISH_SIZE=2G varnish
118+
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G varnish
119119
```
120120

121121
Additionally, you can add arguments to `docker run` after `varnish`, if the first one starts with a `-`, they will be appendend to the [default command](https://github.com/varnish/docker-varnish/blob/master/docker-varnish-entrypoint#L8):
122122

123123
```console
124124
# extend the default keep period
125-
$ docker run --tmpfs /var/lib/varnish:exec -e VARNISH_SIZE=2G varnish -p default_keep=300
125+
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G varnish -p default_keep=300
126126
```
127127

128128
If your first argument after `varnish` doesn't start with `-`, it will be interpreted as a command to override the default one:
@@ -141,7 +141,7 @@ $ docker run varnish varnishd -a :8080 -b 127.0.0.1:8181 -t 600 -p feature=+http
141141
## Exposing the port
142142

143143
```console
144-
$ docker run --name my-running-varnish --tmpfs /var/lib/varnish:exec -d -p 8080:80 my-varnish
144+
$ docker run --name my-running-varnish --tmpfs /var/lib/varnish/varnishd:exec -d -p 8080:80 my-varnish
145145
```
146146

147147
Then you can hit `http://localhost:8080` or `http://host-ip:8080` in your browser.

0 commit comments

Comments
 (0)