I'm having trouble understanding the output of docker ps -all
after starting the same docker container multiple times (because there is a problem with my understanding of docker).
To illustrate the issue:
I create a docker container by issuing:
docker create busybox date
which returns something likeb48a2a768679dd5cdb767d24f6632d6c3d37f735596bf2b5e47517b495d641af
Next I do the following:
$ docker start -a b48a2a768679dd5cdb767d24f6632d6c3d37f735596bf2b5e47517b495d641af
Sat Jan 22 03:14:24 UTC 2022
$ docker start -a b48a2a768679dd5cdb767d24f6632d6c3d37f735596bf2b5e47517b495d641af
Sat Jan 22 03:14:26 UTC 2022
$ sleep 20
$ docker start -a b48a2a768679dd5cdb767d24f6632d6c3d37f735596bf2b5e47517b495d641af
Sat Jan 22 03:14:53 UTC 2022
$ docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b48a2a768679 busybox "date" About a minute ago Exited (0) 4 seconds ago sad_robinson
Now I see two problems with the docker ps -all
output:
I think I should list all my instances of docker start -- since the output was different, I reckon each was a different start of the same container (as you can see I only see one row in the
ps -all
output)The output from
ps -all
seems to list the first start as I ran all of these commands right after the other and other than the sleep command all of them returned immediately yet the output ofps -all
reflects a start time of "about a minute ago"