Skip to content

Commit 47ba76a

Browse files
committed
docs: use "console" code-hint for shell examples
This replaces the use of bash where suitable, to allow easier copy/pasting of shell examples without copying the prompt or process output. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 16466f1 commit 47ba76a

127 files changed

Lines changed: 861 additions & 812 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/deprecated.md

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

592-
```bash
592+
```console
593593
{% raw %}
594-
docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"
594+
$ docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"
595595
{% endraw %}
596596
```
597597

docs/extend/index.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ enabled, and use it to create a volume.
5555
5656
1. Install the `sshfs` plugin.
5757

58-
```bash
58+
```console
5959
$ docker plugin install vieux/sshfs
6060

6161
Plugin "vieux/sshfs" is requesting the following privileges:
@@ -74,7 +74,7 @@ enabled, and use it to create a volume.
7474

7575
2. Check that the plugin is enabled in the output of `docker plugin ls`.
7676

77-
```bash
77+
```console
7878
$ docker plugin ls
7979

8080
ID NAME TAG DESCRIPTION ENABLED
@@ -87,7 +87,7 @@ enabled, and use it to create a volume.
8787

8888
This volume can now be mounted into containers.
8989

90-
```bash
90+
```console
9191
$ docker volume create \
9292
-d vieux/sshfs \
9393
--name sshvolume \
@@ -96,9 +96,10 @@ enabled, and use it to create a volume.
9696

9797
sshvolume
9898
```
99+
99100
4. Verify that the volume was created successfully.
100101

101-
```bash
102+
```console
102103
$ docker volume ls
103104

104105
DRIVER NAME
@@ -107,18 +108,19 @@ enabled, and use it to create a volume.
107108

108109
5. Start a container that uses the volume `sshvolume`.
109110

110-
```bash
111+
```console
111112
$ docker run --rm -v sshvolume:/data busybox ls /data
112113

113114
<content of /remote on machine 1.2.3.4>
114115
```
115116

116117
6. Remove the volume `sshvolume`
117-
```bash
118-
docker volume rm sshvolume
118+
```console
119+
$ docker volume rm sshvolume
119120

120121
sshvolume
121122
```
123+
122124
To disable a plugin, use the `docker plugin disable` command. To completely
123125
remove it, use the `docker plugin remove` command. For other available
124126
commands and options, see the
@@ -134,7 +136,7 @@ example, it was created from a Dockerfile:
134136
>**Note:** The `/run/docker/plugins` directory is mandatory inside of the
135137
plugin's filesystem for docker to communicate with the plugin.
136138

137-
```bash
139+
```console
138140
$ git clone https://github.com/vieux/docker-volume-sshfs
139141
$ cd docker-volume-sshfs
140142
$ docker build -t rootfsimage .
@@ -193,13 +195,13 @@ Stdout of a plugin is redirected to dockerd logs. Such entries have a
193195
`f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62` and their
194196
corresponding log entries in the docker daemon logs.
195197

196-
```bash
198+
```console
197199
$ docker plugin install tiborvass/sample-volume-plugin
198200

199201
INFO[0036] Starting... Found 0 volumes on startup plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
200202
```
201203

202-
```bash
204+
```console
203205
$ docker volume create -d tiborvass/sample-volume-plugin samplevol
204206

205207
INFO[0193] Create Called... Ensuring directory /data/samplevol exists on host... plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
@@ -208,7 +210,7 @@ INFO[0193] Created volume samplevol with mountpoint /data/samp
208210
INFO[0193] Path Called... Returned path /data/samplevol plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
209211
```
210212

211-
```bash
213+
```console
212214
$ docker run -v samplevol:/tmp busybox sh
213215

214216
INFO[0421] Get Called... Found samplevol plugin=f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62
@@ -223,7 +225,7 @@ INFO[0421] Unmount Called... Unmounted samplevol plugin=f52a3df433b9a
223225
plugins. This is specifically useful to collect plugin logs if they are
224226
redirected to a file.
225227

226-
```bash
228+
```console
227229
$ sudo docker-runc --root /var/run/docker/plugins/runtime-root/moby-plugins list
228230

229231
ID PID STATUS BUNDLE CREATED OWNER
@@ -232,13 +234,14 @@ ID PID S
232234
c5bb4b90941efcaccca999439ed06d6a6affdde7081bb34dc84126b57b3e793d 14984 running /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby-plugins/c5bb4b90941efcaccca999439ed06d6a6affdde7081bb34dc84126b57b3e793d 2018-02-08T21:35:12.321288966Z root
233235
```
234236

235-
```bash
237+
```console
236238
$ sudo docker-runc --root /var/run/docker/plugins/runtime-root/moby-plugins exec 93f1e7dbfe11c938782c2993628c895cf28e2274072c4a346a6002446c949b25 cat /var/log/plugin.log
237239
```
238240

239241
If the plugin has a built-in shell, then exec into the plugin can be done as
240242
follows:
241-
```bash
243+
244+
```console
242245
$ sudo docker-runc --root /var/run/docker/plugins/runtime-root/moby-plugins exec -t 93f1e7dbfe11c938782c2993628c895cf28e2274072c4a346a6002446c949b25 sh
243246
```
244247

@@ -251,17 +254,18 @@ the plugin is listening on the said socket. For a well functioning plugin,
251254
these basic requests should work. Note that plugin sockets are available on the host under `/var/run/docker/plugins/<pluginID>`
252255

253256

254-
```bash
255-
curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/e8a37ba56fc879c991f7d7921901723c64df6b42b87e6a0b055771ecf8477a6d/plugin.sock http:/VolumeDriver.List
257+
```console
258+
$ curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/e8a37ba56fc879c991f7d7921901723c64df6b42b87e6a0b055771ecf8477a6d/plugin.sock http:/VolumeDriver.List
256259

257260
{"Mountpoint":"","Err":"","Volumes":[{"Name":"myvol1","Mountpoint":"/data/myvol1"},{"Name":"myvol2","Mountpoint":"/data/myvol2"}],"Volume":null}
258261
```
259262

260-
```bash
261-
curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/45e00a7ce6185d6e365904c8bcf62eb724b1fe307e0d4e7ecc9f6c1eb7bcdb70/plugin.sock http:/NetworkDriver.GetCapabilities
263+
```console
264+
$ curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/45e00a7ce6185d6e365904c8bcf62eb724b1fe307e0d4e7ecc9f6c1eb7bcdb70/plugin.sock http:/NetworkDriver.GetCapabilities
262265

263266
{"Scope":"local"}
264267
```
268+
265269
When using curl 7.5 and above, the URL should be of the form
266270
`http://hostname/APICall`, where `hostname` is the valid hostname where the
267271
plugin is installed and `APICall` is the call to the plugin API.

docs/extend/plugin_api.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ a `service` file and a `socket` file.
114114

115115
The `service` file (for example `/lib/systemd/system/your-plugin.service`):
116116

117-
```
117+
```systemd
118118
[Unit]
119119
Description=Your plugin
120120
Before=docker.service
@@ -127,9 +127,10 @@ ExecStart=/usr/lib/docker/your-plugin
127127
[Install]
128128
WantedBy=multi-user.target
129129
```
130+
130131
The `socket` file (for example `/lib/systemd/system/your-plugin.socket`):
131132

132-
```
133+
```systemd
133134
[Unit]
134135
Description=Your plugin
135136
@@ -166,7 +167,8 @@ Plugins are activated via the following "handshake" API call.
166167
**Request:** empty body
167168

168169
**Response:**
169-
```
170+
171+
```json
170172
{
171173
"Implements": ["VolumeDriver"]
172174
}

docs/extend/plugins_authorization.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,34 +116,34 @@ value. This value can be the plugin’s socket or a path to a specification file
116116
Authorization plugins can be loaded without restarting the daemon. Refer
117117
to the [`dockerd` documentation](../reference/commandline/dockerd.md#configuration-reloading) for more information.
118118

119-
```bash
119+
```console
120120
$ dockerd --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
121121
```
122122

123123
Docker's authorization subsystem supports multiple `--authorization-plugin` parameters.
124124

125125
### Calling authorized command (allow)
126126

127-
```bash
127+
```console
128128
$ docker pull centos
129-
...
129+
<...>
130130
f1b10cd84249: Pull complete
131-
...
131+
<...>
132132
```
133133

134134
### Calling unauthorized command (deny)
135135

136-
```bash
136+
```console
137137
$ docker pull centos
138-
...
138+
<...>
139139
docker: Error response from daemon: authorization denied by plugin PLUGIN_NAME: volumes are not allowed.
140140
```
141141

142142
### Error from plugins
143143

144-
```bash
144+
```console
145145
$ docker pull centos
146-
...
146+
<...>
147147
docker: Error response from daemon: plugin PLUGIN_NAME failed with error: AuthZPlugin.AuthZReq: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
148148
```
149149

@@ -180,6 +180,7 @@ should implement the following two methods:
180180
"Err": "The error message if things go wrong"
181181
}
182182
```
183+
183184
#### /AuthZPlugin.AuthZRes
184185

185186
**Request**:

docs/extend/plugins_graphdriver.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You need to install and enable the plugin and then restart the Docker daemon
3131
before using the plugin. See the following example for the correct ordering
3232
of steps.
3333

34-
```
34+
```console
3535
$ docker plugin install cpuguy83/docker-overlay2-graphdriver-plugin # this command also enables the driver
3636
<output suppressed>
3737
$ pkill dockerd
@@ -309,6 +309,7 @@ Get an archive of the changes between the filesystem layers specified by the `ID
309309
and `Parent`. `Parent` may be an empty string, in which case there is no parent.
310310

311311
**Response**:
312+
312313
```
313314
{% raw %}
314315
{{ TAR STREAM }}
@@ -354,6 +355,7 @@ Respond with a non-empty string error if an error occurred.
354355
### /GraphDriver.ApplyDiff
355356

356357
**Request**:
358+
357359
```
358360
{% raw %}
359361
{{ TAR STREAM }}

docs/extend/plugins_logging.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ as they come in once the existing logs have been read.
211211
to determine what set of logs to read.
212212

213213
**Response**:
214+
214215
```
215216
{% raw %}{{ log stream }}{% endraw %}
216217
```

docs/extend/plugins_network.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Once running however, network driver plugins are used just like the built-in
4242
network drivers: by being mentioned as a driver in network-oriented Docker
4343
commands. For example,
4444

45-
```bash
45+
```console
4646
$ docker network create --driver weave mynet
4747
```
4848

@@ -51,7 +51,7 @@ Some network driver plugins are listed in [plugins](legacy_plugins.md)
5151
The `mynet` network is now owned by `weave`, so subsequent commands
5252
referring to that network will be sent to the plugin,
5353

54-
```bash
54+
```console
5555
$ docker run --network=mynet busybox top
5656
```
5757

0 commit comments

Comments
 (0)