Skip to content

Commit 362e94b

Browse files
author
Benjamin R. Haskell
committed
Disable Liquid templating for blocks with {{
Instead of disabling templating for entire files, fix instances individually by wrapping blocks in: ```{% raw %} ... content ... {% endraw %}``` Signed-off-by: Benjamin R. Haskell <[email protected]>
1 parent 65ec3a3 commit 362e94b

33 files changed

+241
-23
lines changed

engine/admin/formatting.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,46 @@ This is the complete list of the available functions with examples:
3333
Join concatenates a list of strings to create a single string.
3434
It puts a separator between each element in the list.
3535

36+
{% raw %}
3637
$ docker ps --format '{{join .Names " or "}}'
38+
{% endraw %}
3739

3840
### Json
3941

4042
Json encodes an element as a json string.
4143

44+
{% raw %}
4245
$ docker inspect --format '{{json .Mounts}}' container
46+
{% endraw %}
4347

4448
### Lower
4549

4650
Lower turns a string into its lower case representation.
4751

52+
{% raw %}
4853
$ docker inspect --format "{{lower .Name}}" container
54+
{% endraw %}
4955

5056
### Split
5157

5258
Split slices a string into a list of strings separated by a separator.
5359

60+
{% raw %}
5461
# docker inspect --format '{{split (join .Names "/") "/"}}' container
62+
{% endraw %}
5563

5664
### Title
5765

5866
Title capitalizes a string.
5967

68+
{% raw %}
6069
$ docker inspect --format "{{title .Name}}" container
70+
{% endraw %}
6171

6272
### Upper
6373

6474
Upper turns a string into its upper case representation.
6575

76+
{% raw %}
6677
$ docker inspect --format "{{upper .Name}}" container
78+
{% endraw %}

engine/admin/logging/fluentd.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ The `docker logs` command is not available for this logging driver.
3333

3434
Some options are supported by specifying `--log-opt` as many times as needed:
3535

36+
{% raw %}
3637
- `fluentd-address`: specify `host:port` to connect `localhost:24224`
3738
- `tag`: specify tag for fluentd message, which interpret some markup, ex `{{.ID}}`, `{{.FullID}}` or `{{.Name}}` `docker.{{.ID}}`
39+
{% endraw %}
3840

3941

4042
Configure the default logging driver by passing the

engine/admin/logging/log_tags.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ docker run --log-driver=fluentd --log-opt fluentd-address=myhost.local:24224 --l
2323

2424
Docker supports some special template markup you can use when specifying a tag's value:
2525

26+
{% raw %}
2627
| Markup | Description |
2728
|--------------------|------------------------------------------------------|
2829
| `{{.ID}}` | The first 12 characters of the container id. |
@@ -34,30 +35,33 @@ Docker supports some special template markup you can use when specifying a tag's
3435
| `{{.DaemonName}}` | The name of the docker program (`docker`). |
3536

3637
For example, specifying a `--log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"` value yields `syslog` log lines like:
38+
{% endraw %}
3739

3840
```
3941
Aug 7 18:33:19 HOSTNAME docker/hello-world/foobar/5790672ab6a0[9103]: Hello from Docker.
4042
```
4143

44+
{% raw %}
4245
At startup time, the system sets the `container_name` field and `{{.Name}}` in
4346
the tags. If you use `docker rename` to rename a container, the new name is not
4447
reflected in the log messages. Instead, these messages continue to use the
4548
original container name.
49+
{% endraw %}
4650

4751
For advanced usage, the generated tag's use [go
4852
templates](http://golang.org/pkg/text/template/) and the container's [logging
4953
context](https://github.com/docker/docker/blob/master/daemon/logger/context.go).
5054

5155
As an example of what is possible with the syslog logger:
5256

53-
```
57+
```{% raw %}
5458
$ docker run -it --rm \
5559
--log-driver syslog \
5660
--log-opt tag="{{ (.ExtraAttributes nil).SOME_ENV_VAR }}" \
5761
--log-opt env=SOME_ENV_VAR \
5862
-e SOME_ENV_VAR=logtester.1234 \
5963
flyinprogrammer/logtester
60-
```
64+
{% endraw %}```
6165
6266
Results in logs like this:
6367

engine/admin/logging/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ logging driver options.
243243

244244
For example, to specify both additional options:
245245

246-
```bash
246+
```bash{% raw %}
247247
$ docker run -dit \
248248
--log-driver=fluentd \
249249
--log-opt fluentd-address=localhost:24224 \
250250
--log-opt tag="docker.{{.Name}}" \
251251
alpine sh
252-
```
252+
{% endraw %}```
253253
254254
If container cannot connect to the Fluentd daemon on the specified address and
255255
`fluentd-async-connect` is not enabled, the container stops immediately.

engine/admin/logging/splunk.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ You can set the logging driver for a specific container by using the
3333
You can use the `--log-opt NAME=VALUE` flag to specify these additional Splunk
3434
logging driver options:
3535

36+
{% raw %}
3637
| Option | Required | Description |
3738
|-----------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3839
| `splunk-token` | required | Splunk HTTP Event Collector token. |
@@ -46,6 +47,7 @@ logging driver options:
4647
| `tag` | optional | Specify tag for message, which interpret some markup. Default value is `{{.ID}}` (12 characters of the container ID). Refer to the [log tag option documentation](log_tags.md) for customizing the log tag format. |
4748
| `labels` | optional | Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. |
4849
| `env` | optional | Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. |
50+
{% endraw %}
4951

5052
If there is collision between `label` and `env` keys, the value of the `env` takes precedence.
5153
Both options add additional fields to the attributes of a logging message.
@@ -56,6 +58,7 @@ Docker daemon is running. The path to the root certificate and Common Name is
5658
specified using an HTTPS scheme. This is used for verification.
5759
The `SplunkServerDefaultCert` is automatically generated by Splunk certificates.
5860

61+
{% raw %}
5962
docker run --log-driver=splunk \
6063
--log-opt splunk-token=176FCEBF-4CF5-4EDF-91BC-703796522D20 \
6164
--log-opt splunk-url=https://splunkhost:8088 \
@@ -67,3 +70,4 @@ The `SplunkServerDefaultCert` is automatically generated by Splunk certificates.
6770
--env "TEST=false"
6871
--label location=west
6972
your/application
73+
{% endraw %}

engine/deprecated.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ Log tags are now generated in a standard way across different logging drivers.
106106
Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` and
107107
`fluentd-tag` have been deprecated in favor of the generic `tag` option.
108108

109+
{% raw %}
109110
docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"
111+
{% endraw %}
110112

111113
### LXC built-in exec driver
112114
**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**

engine/reference/api/docker_remote_api_v1.18.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,9 @@ Get `stdout` and `stderr` logs from the container ``id``
523523
Connection: Upgrade
524524
Upgrade: tcp
525525

526+
{% raw %}
526527
{{ STREAM }}
528+
{% endraw %}
527529

528530
**Query parameters**:
529531

@@ -598,7 +600,9 @@ Export the contents of container `id`
598600
HTTP/1.1 200 OK
599601
Content-Type: application/octet-stream
600602

603+
{% raw %}
601604
{{ TAR STREAM }}
605+
{% endraw %}
602606

603607
**Status codes**:
604608

@@ -902,7 +906,9 @@ Attach to the container `id`
902906
Connection: Upgrade
903907
Upgrade: tcp
904908

909+
{% raw %}
905910
{{ STREAM }}
911+
{% endraw %}
906912

907913
**Query parameters**:
908914

@@ -982,7 +988,9 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
982988

983989
**Example response**
984990

991+
{% raw %}
985992
{{ STREAM }}
993+
{% endraw %}
986994

987995
**Query parameters**:
988996

@@ -1075,7 +1083,9 @@ Copy files or folders of container `id`
10751083
HTTP/1.1 200 OK
10761084
Content-Type: application/x-tar
10771085

1086+
{% raw %}
10781087
{{ TAR STREAM }}
1088+
{% endraw %}
10791089

10801090
**Status codes**:
10811091

@@ -1181,7 +1191,9 @@ Build an image from a Dockerfile
11811191

11821192
POST /build HTTP/1.1
11831193

1194+
{% raw %}
11841195
{{ TAR STREAM }}
1196+
{% endraw %}
11851197

11861198
**Example response**:
11871199

@@ -1942,7 +1954,9 @@ interactive session with the `exec` command.
19421954
HTTP/1.1 200 OK
19431955
Content-Type: application/vnd.docker.raw-stream
19441956

1957+
{% raw %}
19451958
{{ STREAM }}
1959+
{% endraw %}
19461960

19471961
**JSON parameters**:
19481962

engine/reference/api/docker_remote_api_v1.19.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,9 @@ Get `stdout` and `stderr` logs from the container ``id``
537537
Connection: Upgrade
538538
Upgrade: tcp
539539

540+
{% raw %}
540541
{{ STREAM }}
542+
{% endraw %}
541543

542544
**Query parameters**:
543545

@@ -614,7 +616,9 @@ Export the contents of container `id`
614616
HTTP/1.1 200 OK
615617
Content-Type: application/octet-stream
616618

619+
{% raw %}
617620
{{ TAR STREAM }}
621+
{% endraw %}
618622

619623
**Status codes**:
620624

@@ -939,7 +943,9 @@ Attach to the container `id`
939943
Connection: Upgrade
940944
Upgrade: tcp
941945

946+
{% raw %}
942947
{{ STREAM }}
948+
{% endraw %}
943949

944950
**Query parameters**:
945951

@@ -1019,7 +1025,9 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
10191025

10201026
**Example response**
10211027

1028+
{% raw %}
10221029
{{ STREAM }}
1030+
{% endraw %}
10231031

10241032
**Query parameters**:
10251033

@@ -1112,7 +1120,9 @@ Copy files or folders of container `id`
11121120
HTTP/1.1 200 OK
11131121
Content-Type: application/x-tar
11141122

1123+
{% raw %}
11151124
{{ TAR STREAM }}
1125+
{% endraw %}
11161126

11171127
**Status codes**:
11181128

@@ -1223,7 +1233,9 @@ Build an image from a Dockerfile
12231233

12241234
POST /build HTTP/1.1
12251235

1236+
{% raw %}
12261237
{{ TAR STREAM }}
1238+
{% endraw %}
12271239

12281240
**Example response**:
12291241

@@ -2023,7 +2035,9 @@ interactive session with the `exec` command.
20232035
HTTP/1.1 200 OK
20242036
Content-Type: application/vnd.docker.raw-stream
20252037

2038+
{% raw %}
20262039
{{ STREAM }}
2040+
{% endraw %}
20272041

20282042
**JSON parameters**:
20292043

engine/reference/api/docker_remote_api_v1.20.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,9 @@ Get `stdout` and `stderr` logs from the container ``id``
546546
Connection: Upgrade
547547
Upgrade: tcp
548548

549+
{% raw %}
549550
{{ STREAM }}
551+
{% endraw %}
550552

551553
**Query parameters**:
552554

@@ -623,7 +625,9 @@ Export the contents of container `id`
623625
HTTP/1.1 200 OK
624626
Content-Type: application/octet-stream
625627

628+
{% raw %}
626629
{{ TAR STREAM }}
630+
{% endraw %}
627631

628632
**Status codes**:
629633

@@ -948,7 +952,9 @@ Attach to the container `id`
948952
Connection: Upgrade
949953
Upgrade: tcp
950954

955+
{% raw %}
951956
{{ STREAM }}
957+
{% endraw %}
952958

953959
**Query parameters**:
954960

@@ -1028,7 +1034,9 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet
10281034

10291035
**Example response**
10301036

1037+
{% raw %}
10311038
{{ STREAM }}
1039+
{% endraw %}
10321040

10331041
**Query parameters**:
10341042

@@ -1123,7 +1131,9 @@ Copy files or folders of container `id`
11231131
HTTP/1.1 200 OK
11241132
Content-Type: application/x-tar
11251133

1134+
{% raw %}
11261135
{{ TAR STREAM }}
1136+
{% endraw %}
11271137

11281138
**Status codes**:
11291139

@@ -1169,7 +1179,9 @@ Get a tar archive of a resource in the filesystem of container `id`.
11691179
Content-Type: application/x-tar
11701180
X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0=
11711181

1182+
{% raw %}
11721183
{{ TAR STREAM }}
1184+
{% endraw %}
11731185

11741186
On success, a response header `X-Docker-Container-Path-Stat` will be set to a
11751187
base64-encoded JSON object containing some filesystem header information about
@@ -1224,7 +1236,9 @@ Upload a tar archive to be extracted to a path in the filesystem of container
12241236
PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1
12251237
Content-Type: application/x-tar
12261238

1239+
{% raw %}
12271240
{{ TAR STREAM }}
1241+
{% endraw %}
12281242

12291243
**Example response**:
12301244

@@ -1350,7 +1364,9 @@ Build an image from a Dockerfile
13501364

13511365
POST /build HTTP/1.1
13521366

1367+
{% raw %}
13531368
{{ TAR STREAM }}
1369+
{% endraw %}
13541370

13551371
**Example response**:
13561372

@@ -2176,7 +2192,9 @@ interactive session with the `exec` command.
21762192
HTTP/1.1 200 OK
21772193
Content-Type: application/vnd.docker.raw-stream
21782194

2195+
{% raw %}
21792196
{{ STREAM }}
2197+
{% endraw %}
21802198

21812199
**JSON parameters**:
21822200

0 commit comments

Comments
 (0)