Signed-off-by: Misty Stanley-Jones <misty@docker.com>
| ... | ... |
@@ -1222,24 +1222,28 @@ This Dockerfile results in an image that causes `docker run`, to |
| 1222 | 1222 |
create a new mount point at `/myvol` and copy the `greeting` file |
| 1223 | 1223 |
into the newly created volume. |
| 1224 | 1224 |
|
| 1225 |
-> **Note**: |
|
| 1226 |
-> When using Windows-based containers, the destination of a volume inside the |
|
| 1227 |
-> container must be one of: a non-existing or empty directory; or a drive other |
|
| 1228 |
-> than C:. |
|
| 1225 |
+### Notes about specifying volumes |
|
| 1229 | 1226 |
|
| 1230 |
-> **Note**: |
|
| 1231 |
-> If any build steps change the data within the volume after it has been |
|
| 1232 |
-> declared, those changes will be discarded. |
|
| 1227 |
+Keep the following things in mind about volumes in the `Dockerfile`. |
|
| 1233 | 1228 |
|
| 1234 |
-> **Note**: |
|
| 1235 |
-> The list is parsed as a JSON array, which means that |
|
| 1236 |
-> you must use double-quotes (") around words not single-quotes (').
|
|
| 1229 |
+- **Volumes on Windows-based containers**: When using Windows-based containers, |
|
| 1230 |
+ the destination of a volume inside the container must be one of: |
|
| 1231 |
+ |
|
| 1232 |
+ - a non-existing or empty directory |
|
| 1233 |
+ - a drive other than `C:` |
|
| 1234 |
+ |
|
| 1235 |
+- **Changing the volume from within the Dockerfile**: If any build steps change the |
|
| 1236 |
+ data within the volume after it has been declared, those changes will be discarded. |
|
| 1237 |
+ |
|
| 1238 |
+- **JSON formatting**: The list is parsed as a JSON array. |
|
| 1239 |
+ You must enclose words with double quotes (`"`)rather than single quotes (`'`). |
|
| 1237 | 1240 |
|
| 1238 |
->**Note**: The host directory is, by its nature, host-dependent. For this |
|
| 1239 |
->reason, you can't mount a host directory from `Dockerfile`, the `VOLUME` |
|
| 1240 |
-instruction does not support passing a `host-dir`, because built images |
|
| 1241 |
->should be portable. A host directory wouldn't be available on all potential |
|
| 1242 |
->hosts. |
|
| 1241 |
+- **The host directory is declared at container run-time**: The host directory |
|
| 1242 |
+ (the mountpoint) is, by its nature, host-dependent. This is to preserve image |
|
| 1243 |
+ portability. since a given host directory can't be guaranteed to be available |
|
| 1244 |
+ on all hosts.For this reason, you can't mount a host directory from |
|
| 1245 |
+ within the Dockerfile. The `VOLUME` instruction does not support specifying a `host-dir` |
|
| 1246 |
+ parameter. You must specify the mountpoint when you create or run the container. |
|
| 1243 | 1247 |
|
| 1244 | 1248 |
## USER |
| 1245 | 1249 |
|