Update tmpfs mounts example (#15817)

* Update "Mounts" example

In the original example, the "Mounts" field returned by `docker container inspect [CONTAINER]` was not shown. This may be too much data, but we should at least show the "Mounts" field so folks know what to look for.

* shortened the docker inspect example

Co-authored-by: David Karlsson <david.karlsson@docker.com>
This commit is contained in:
Daniel Schroeder 2022-10-27 11:06:55 -05:00 committed by GitHub
parent 9c97e896ab
commit 88fb637b8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 13 deletions

View File

@ -94,21 +94,19 @@ $ docker run -d \
</div><!--volume-->
</div><!--tab-content-->
Verify that the mount is a `tmpfs` mount by running `docker container inspect
tmptest` and looking for the `Mounts` section:
```json
"Tmpfs": {
"/app": ""
},
```
Remove the container:
Verify that the mount is a `tmpfs` mount by looking in the `Mounts` section of
the `docker inspect` output:
```console
$ docker container stop tmptest
$ docker inspect tmptest --format '{{ json .Mounts }}'
[{"Type":"tmpfs","Source":"","Destination":"/app","Mode":"","RW":true,"Propagation":""}]
```
$ docker container rm tmptest
Stop and remove the container:
```console
$ docker stop tmptest
$ docker rm tmptest
```
### Specify tmpfs options
@ -137,4 +135,4 @@ docker run -d \
- Learn about [volumes](volumes.md)
- Learn about [bind mounts](bind-mounts.md)
- Learn about [storage drivers](/storage/storagedriver/)
- Learn about [storage drivers](/storage/storagedriver/)