"docker create" for data containers should specify a dummy command to
avoid accidential "docker start" to cause unexpected data loss.
Signed-off-by: Hong Xu <hong@topbug.net>
| ... | ... |
@@ -124,7 +124,7 @@ Let's create a new named container with a volume to share. |
| 124 | 124 |
While this container doesn't run an application, it reuses the `training/postgres` |
| 125 | 125 |
image so that all containers are using layers in common, saving disk space. |
| 126 | 126 |
|
| 127 |
- $ sudo docker create -v /dbdata --name dbdata training/postgres |
|
| 127 |
+ $ sudo docker create -v /dbdata --name dbdata training/postgres /bin/true |
|
| 128 | 128 |
|
| 129 | 129 |
You can then use the `--volumes-from` flag to mount the `/dbdata` volume in another container. |
| 130 | 130 |
|