Add docker ps for old Docker versions (#6246)

This commit is contained in:
Gwendolynne Barr 2018-03-16 14:22:29 -07:00 committed by GitHub
parent ddc8bc6dd1
commit f4319a5222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 45 additions and 45 deletions

View File

@ -128,65 +128,65 @@ and higher.
### Test Docker version ### Test Docker version
Ensure that you have a supported version of Docker: 1. Run `docker --version` and ensure that you have a supported version of Docker:
```shell ```shell
$ docker --version docker --version
Docker version 17.12.0-ce, build c97c6d6
```
Run `docker version`(without `--`) or `docker info` to view even more details Docker version 17.12.0-ce, build c97c6d6
about your docker installation: ```
```shell 2. Run `docker info` or (`docker version` without `--`) to view even more details about your docker installation:
$ docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.12.0-ce
Storage Driver: overlay2
...
```
> **Note**: To avoid permission errors (and the use of `sudo`), add your user to ```shell
> the `docker` group. [Read more](https://docs.docker.com/engine/installation/linux/linux-postinstall/){: target="_blank" class="_"}. docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.12.0-ce
Storage Driver: overlay2
...
```
> To avoid permission errors (and the use of `sudo`), add your user to the `docker` group. [Read more](https://docs.docker.com/engine/installation/linux/linux-postinstall/){: target="_blank" class="_"}.
### Test Docker installation ### Test Docker installation
Test that your installation works by running the simple Docker image, 1. Test that your installation works by running the simple Docker image,
[hello-world](https://hub.docker.com/_/hello-world/){: target="_blank" class="_"}: [hello-world](https://hub.docker.com/_/hello-world/){: target="_blank" class="_"}:
```shell ```shell
$ docker run hello-world docker run hello-world
Unable to find image 'hello-world:latest' locally Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete ca4f61b1923c: Pull complete
Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7 Digest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7
Status: Downloaded newer image for hello-world:latest Status: Downloaded newer image for hello-world:latest
Hello from Docker! Hello from Docker!
This message shows that your installation appears to be working correctly. This message shows that your installation appears to be working correctly.
... ...
``` ```
List the `hello-world` image that was downloaded to your machine: 2. List the `hello-world` image that was downloaded to your machine:
```shell ```shell
$ docker image ls docker image ls
``` ```
List the `hello-world` container (spawned by the image), which exits after 3. List the `hello-world` container (spawned by the image) which exits after
displaying its message. If it were still running, you would _not_ need the displaying its message. If it were still running, you would not need the `--all` option:
`--all` option:
```shell ```shell
$ docker container ls --all docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED STATUS
54f4984ed6a8 hello-world "/hello" 20 seconds ago Exited (0) 19 seconds ago CONTAINER ID IMAGE COMMAND CREATED STATUS
``` 54f4984ed6a8 hello-world "/hello" 20 seconds ago Exited (0) 19 seconds ago
```
## Recap and cheat sheet ## Recap and cheat sheet
@ -209,7 +209,7 @@ docker image ls
## List Docker containers (running, all, all in quiet mode) ## List Docker containers (running, all, all in quiet mode)
docker container ls docker container ls
docker container ls --all docker container ls --all
docker container ls -a -q docker container ls -aq
``` ```
## Conclusion of part one ## Conclusion of part one