Skip to content

Commit 36db5f6

Browse files
authoredFeb 1, 2017
Merge pull request moby#30011 from davidwilliamson/patch-1
Provide password to volume create command
2 parents 6365d8d + d9e5f7d commit 36db5f6

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed
 

‎docs/extend/index.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ operation, such as creating a volume.
4646
In the following example, you install the `sshfs` plugin, verify that it is
4747
enabled, and use it to create a volume.
4848

49+
> **Note**: This example is intended for instructional purposes only. Once the volume is created, your SSH password to the remote host will be exposed as plaintext when inspecting the volume. You should delete the volume as soon as you are done with the example.
50+
4951
1. Install the `sshfs` plugin.
5052

5153
```bash
@@ -75,13 +77,16 @@ enabled, and use it to create a volume.
7577

7678
3. Create a volume using the plugin.
7779
This example mounts the `/remote` directory on host `1.2.3.4` into a
78-
volume named `sshvolume`. This volume can now be mounted into containers.
80+
volume named `sshvolume`.
81+
82+
This volume can now be mounted into containers.
7983

8084
```bash
8185
$ docker volume create \
8286
-d vieux/sshfs \
8387
--name sshvolume \
84-
-o sshcmd=user@1.2.3.4:/remote
88+
-o sshcmd=user@1.2.3.4:/remote \
89+
-o password=$(cat file_containing_password_for_remote_host)
8590
8691
sshvolume
8792
```
@@ -97,11 +102,17 @@ enabled, and use it to create a volume.
97102
5. Start a container that uses the volume `sshvolume`.
98103

99104
```bash
100-
$ docker run -v sshvolume:/data busybox ls /data
105+
$ docker run --rm -v sshvolume:/data busybox ls /data
101106
102107
<content of /remote on machine 1.2.3.4>
103108
```
104109

110+
6. Remove the volume `sshvolume`
111+
```bash
112+
docker volume rm sshvolume
113+
114+
sshvolume
115+
```
105116
To disable a plugin, use the `docker plugin disable` command. To completely
106117
remove it, use the `docker plugin remove` command. For other available
107118
commands and options, see the

0 commit comments

Comments
 (0)
Please sign in to comment.