Browse code

Merge pull request #30011 from davidwilliamson/patch-1

Provide password to volume create command
(cherry picked from commit 36db5f6f6895d62a04e509ad958fe3566d5780ba)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2017/02/01 12:20:30
Showing 1 changed files
... ...
@@ -46,6 +46,8 @@ operation, such as creating a volume.
46 46
 In the following example, you install the `sshfs` plugin, verify that it is
47 47
 enabled, and use it to create a volume.
48 48
 
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
+
49 51
 1.  Install the `sshfs` plugin.
50 52
 
51 53
     ```bash
... ...
@@ -75,13 +77,16 @@ enabled, and use it to create a volume.
75 75
 
76 76
 3.  Create a volume using the plugin.
77 77
     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.
78
+    volume named `sshvolume`.   
79
+   
80
+    This volume can now be mounted into containers.
79 81
 
80 82
     ```bash
81 83
     $ docker volume create \
82 84
       -d vieux/sshfs \
83 85
       --name sshvolume \
84
-      -o sshcmd=user@1.2.3.4:/remote
86
+      -o sshcmd=user@1.2.3.4:/remote \
87
+      -o password=$(cat file_containing_password_for_remote_host)
85 88
 
86 89
     sshvolume
87 90
     ```
... ...
@@ -97,11 +102,17 @@ enabled, and use it to create a volume.
97 97
 5.  Start a container that uses the volume `sshvolume`.
98 98
 
99 99
     ```bash
100
-    $ docker run -v sshvolume:/data busybox ls /data
100
+    $ docker run --rm -v sshvolume:/data busybox ls /data
101 101
 
102 102
     <content of /remote on machine 1.2.3.4>
103 103
     ```
104 104
 
105
+6.  Remove the volume `sshvolume`
106
+    ```bash
107
+    docker volume rm sshvolume
108
+    
109
+    sshvolume
110
+    ```
105 111
 To disable a plugin, use the `docker plugin disable` command. To completely
106 112
 remove it, use the `docker plugin remove` command. For other available
107 113
 commands and options, see the