when calling docker ps the list is empty, although I got an id:
(dcbb6aeaa06ba43fcb.....)
My steps:
Step 1: I created an image (imagekommando) of an running js.file:

Step 2: I created a container (in background) based on my image
docker run -d --name containerkommando imagekommando

I got an id! (container-id??)
Step 3: But docker ps shows empty list:

But when I repeat Step 2, I'm told, that the container (containerkommando) already exists:
docker run -d --name containerkommando imagekommando

Could you help me, understanding the logic behind? And how can I get the container running (by ID)?
That means that the docker container exited with an error but clean up is required. With --rm option you can tell the docker to remove the container when the container has exited.
docker run --rm .....
Also to check the reason for the container exiting...you can use
docker logs <container_id>
What probably takes place here:
docker run ... creates and starts your containerdocker ps doesn't list stopped containers (default shows just running), so it made you think that it's not there.docker run ... fails because you are trying to create and run a container with a name that already exists.Further reading:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With