Docker Community Forums

Share and learn in the Docker community.

**docker ps** shows nothing but docker ps -a shows one container

pi@pi01:~ $ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
pi@pi01:~ $ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                        PORTS               NAMES
f2c42ac83469        arm64v8/alpine      "/bin/sh"           52 minutes ago      Exited (159) 33 minutes ago                       frosty_chaum

I clearly have one container, but it seems it’s NOT running? And if I want to pop up /bin/sh in this container, I got an error:

pi@pi01:~ $ docker exec -it f2c42ac83469 /bin/sh
Error response from daemon: Container f2c42ac834698ca2a60d9dd9fa17e5284f2fbdf59a11e9b819efa8f28b37f107 is not running

Can anybody help to explain what are the differences between docker ps and docker ps -a?

Cheers
Pei

A good starting point is to take a look in the command reference for docker ps

Thank you meyay… So prompt :slight_smile:

How can I keep a container running? And how can I revoke the sleeping container to get running again??

you need to fix whatever is the reason your container does not keep running.

You should make it a habbit to read the docker documentation - almost everything is well documented.
It is not realy fun to support people who don’t even bother to learn the basics about a technology.

Thank you meyay… I found exactly the same issue on stackoverflow

Keep investigating … Thank you …