Misty's edits and additions
Signed-off-by: Misty Stanley-Jones <misty@docker.com> (cherry picked from commit 3de7d725137ee1620ae2050e65ace4990a3af87e) Upstream-commit: 5880d629533d9b8ad9889500fe841cb2e31a71c8 Component: engine
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
e605090acb
commit
dd0606cd40
@ -69,19 +69,36 @@ $ docker service update --limit-cpu 2 redis
|
||||
|
||||
### Adding and removing mounts
|
||||
|
||||
You can add, or remove bind-mounts or volumes to a service using the
|
||||
`--mount-add` and `--mount-rm` options.
|
||||
Use the `--mount-add` or `--mount-rm` options add or remove a service's bind-mounts
|
||||
or volumes.
|
||||
|
||||
The following example creates a service using the `test-data` volume, then
|
||||
updates the service to mount another volume, and finally unmounts the first
|
||||
volume:
|
||||
The following example creates a service which mounts the `test-data` volume to
|
||||
`/somewhere`. The next step updates the service to also mount the `other-volume`
|
||||
volume to `/somewhere-else`volume, The last step unmounts the `/somewhere` mount
|
||||
point, effectively removing the `test-data` volume. Each command returns the
|
||||
service name.
|
||||
|
||||
- The `--mount-add` flag takes the same parameters as the `--mount` flag on
|
||||
`service create`. Refer to the [volumes and
|
||||
bind-mounts](service_create.md#volumes-and-bind-mounts-mount) section in the
|
||||
`service create` reference for details.
|
||||
|
||||
- The `--mount-rm` flag takes the `target` path of the mount.
|
||||
|
||||
```bash
|
||||
$ docker service create --name=myservice --mount type=volume,source=test-data,target=/somewhere nginx:alpine
|
||||
$ docker service create \
|
||||
--name=myservice \
|
||||
--mount \
|
||||
type=volume,source=test-data,target=/somewhere \
|
||||
nginx:alpine \
|
||||
myservice
|
||||
|
||||
myservice
|
||||
|
||||
$ docker service update --mount-add type=volume,source=other-volume,target=/somewhere-else myservice
|
||||
$ docker service update \
|
||||
--mount-add \
|
||||
type=volume,source=other-volume,target=/somewhere-else \
|
||||
myservice
|
||||
|
||||
myservice
|
||||
|
||||
@ -90,12 +107,6 @@ $ docker service update --mount-rm /somewhere myservice
|
||||
myservice
|
||||
```
|
||||
|
||||
The `--mount-rm` flag takes the `target` path of the mount. The `--mount-add`
|
||||
flag takes the same parameters as the `--mount` flag on `service create`. Refer
|
||||
to the [volumes and bind-mounts](service_create.md#volumes-and-bind-mounts-mount) section in the
|
||||
`service create` reference for details.
|
||||
|
||||
|
||||
## Related information
|
||||
|
||||
* [service create](service_create.md)
|
||||
|
||||
Reference in New Issue
Block a user