You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: varnish/README.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ Then run:
76
76
```console
77
77
# we need both a configuration file at /etc/varnish/default.vcl
78
78
# 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
80
80
```
81
81
82
82
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/
90
90
Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
@@ -115,14 +115,14 @@ docker run varnish varnishreload -h
115
115
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:
116
116
117
117
```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
119
119
```
120
120
121
121
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):
122
122
123
123
```console
124
124
# 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
126
126
```
127
127
128
128
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
0 commit comments