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,18 +128,19 @@ 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 Docker version 17.12.0-ce, build c97c6d6
``` ```
Run `docker version`(without `--`) or `docker info` to view even more details 2. Run `docker info` or (`docker version` without `--`) to view even more details about your docker installation:
about your docker installation:
```shell ```shell
$ docker info docker info
Containers: 0 Containers: 0
Running: 0 Running: 0
Paused: 0 Paused: 0
@ -150,16 +151,15 @@ Storage Driver: overlay2
... ...
``` ```
> **Note**: To avoid permission errors (and the use of `sudo`), add your user to > 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="_"}.
> 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
@ -172,18 +172,18 @@ 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 CONTAINER ID IMAGE COMMAND CREATED STATUS
54f4984ed6a8 hello-world "/hello" 20 seconds ago Exited (0) 19 seconds ago 54f4984ed6a8 hello-world "/hello" 20 seconds ago Exited (0) 19 seconds ago
``` ```
@ -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