Update dockervolumes.md - Changed all wrong /opt/webapp

Changed all wrong /opt/webapp as /webapp

/opt/webapp of web container includes app.py, if set destination folder as /opt/webapp, app.py is not visible and below error log presents and the web container will exit, so it's better to set the destination folder as /webapp.

docker logs -f web
python: can't open file 'app.py': [Errno 2] No such file or directory
This commit is contained in:
Water Wang 2016-10-11 09:54:25 +08:00 committed by GitHub
parent 539f8aa082
commit 96eec5a7b9
1 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ $ docker run -d -P --name web -v /src/webapp:/webapp training/webapp python app.
``` ```
This command mounts the host directory, `/src/webapp`, into the container at This command mounts the host directory, `/src/webapp`, into the container at
`/opt/webapp`. If the path `/opt/webapp` already exists inside the container's `/webapp`. If the path `/webapp` already exists inside the container's
image, the `/src/webapp` mount overlays but does not remove the pre-existing image, the `/src/webapp` mount overlays but does not remove the pre-existing
content. Once the mount is removed, the content is accessible again. This is content. Once the mount is removed, the content is accessible again. This is
consistent with the expected behavior of the `mount` command. consistent with the expected behavior of the `mount` command.
@ -152,7 +152,7 @@ Docker volumes default to mount in read-write mode, but you can also set it to
be mounted read-only. be mounted read-only.
```bash ```bash
$ docker run -d -P --name web -v /src/webapp:/opt/webapp:ro training/webapp python app.py $ docker run -d -P --name web -v /src/webapp:/webapp:ro training/webapp python app.py
``` ```
Here you've mounted the same `/src/webapp` directory but you've added the `ro` Here you've mounted the same `/src/webapp` directory but you've added the `ro`
@ -186,12 +186,12 @@ the other examples.
The following command creates a named volume, called `my-named-volume`, The following command creates a named volume, called `my-named-volume`,
using the `flocker` volume driver, and makes it available within the container using the `flocker` volume driver, and makes it available within the container
at `/opt/webapp`: at `/webapp`:
```bash ```bash
$ docker run -d -P \ $ docker run -d -P \
--volume-driver=flocker \ --volume-driver=flocker \
-v my-named-volume:/opt/webapp \ -v my-named-volume:/webapp \
--name web training/webapp python app.py --name web training/webapp python app.py
``` ```
@ -205,7 +205,7 @@ using the `docker volume create` command.
$ docker volume create -d flocker -o size=20GB my-named-volume $ docker volume create -d flocker -o size=20GB my-named-volume
$ docker run -d -P \ $ docker run -d -P \
-v my-named-volume:/opt/webapp \ -v my-named-volume:/webapp \
--name web training/webapp python app.py --name web training/webapp python app.py
``` ```