Skip to content

Commit 905e67e

Browse files
authored
Merge pull request #2125 from gquintard/varnish_tmpfs
[varnish] adjust the tmpfs directory for permission reasons
2 parents 92295e3 + 2b8f3d1 commit 905e67e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

varnish/content.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Then run:
2525
```console
2626
# we need both a configuration file at /etc/varnish/default.vcl
2727
# and our workdir to be mounted as tmpfs to avoid disk I/O
28-
$ docker run -v /path/to/default.vcl:/etc/varnish/default.vcl:ro --tmpfs /var/lib/varnish:exec %%IMAGE%%
28+
$ docker run -v /path/to/default.vcl:/etc/varnish/default.vcl:ro --tmpfs /var/lib/varnish/varnishd:exec %%IMAGE%%
2929
```
3030

3131
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):
@@ -39,7 +39,7 @@ COPY default.vcl /etc/varnish/
3939
Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
4040

4141
```console
42-
$ docker --tmpfs /var/lib/varnish:exec my-varnish
42+
$ docker --tmpfs /var/lib/varnish/varnishd:exec my-varnish
4343
```
4444

4545
## Reloading the configuration
@@ -64,14 +64,14 @@ docker run varnish varnishreload -h
6464
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:
6565

6666
```console
67-
$ docker run --tmpfs /var/lib/varnish:exec -e VARNISH_SIZE=2G %%IMAGE%%
67+
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G %%IMAGE%%
6868
```
6969

7070
Additionally, you can add arguments to `docker run` after `%%IMAGE%%`, 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):
7171

7272
```console
7373
# extend the default keep period
74-
$ docker run --tmpfs /var/lib/varnish:exec -e VARNISH_SIZE=2G %%IMAGE%% -p default_keep=300
74+
$ docker run --tmpfs /var/lib/varnish/varnishd:exec -e VARNISH_SIZE=2G %%IMAGE%% -p default_keep=300
7575
```
7676

7777
If your first argument after `%%IMAGE%%` doesn't start with `-`, it will be interpreted as a command to override the default one:
@@ -90,7 +90,7 @@ $ docker run %%IMAGE%% varnishd -a :8080 -b 127.0.0.1:8181 -t 600 -p feature=+ht
9090
## Exposing the port
9191

9292
```console
93-
$ docker run --name my-running-varnish --tmpfs /var/lib/varnish:exec -d -p 8080:80 my-varnish
93+
$ docker run --name my-running-varnish --tmpfs /var/lib/varnish/varnishd:exec -d -p 8080:80 my-varnish
9494
```
9595

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

0 commit comments

Comments
 (0)