Docker container will automatically stop after docker run -d

+1 vote

According to the tutorials I've read so far, using "docker run -d" will start a container from an image and run it in the background. This is how it appears; we can see that we already have a container id.

root@docker:/home/root# docker run -d centos
605e3928cdddb844526bab691af51d0c9262e0a1fc3d41de3f59be1a58e1bd1d

But if I ran "docker ps", nothing was returned.

So I tried "docker ps -a", I can see container already exited:

root@docker:/home/root# docker ps -a
CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS                         PORTS               NAMES
605e3928cddd        centos:latest         "/bin/bash"         31 minutes ago      Exited (0) 31 minutes ago                          kickass_swartz

Is there anything I did wrong? How can I resolve this problem?

Jan 2, 2023 in DevOps on Cloud by Damonlang
• 1,230 points
551 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In DevOps on Cloud

0 votes
1 answer

My docker container has no internet

To begin, run cat /etc/resolv.conf in the ...READ MORE

answered Jan 3, 2023 in DevOps on Cloud by David
• 220 points
4,648 views
0 votes
0 answers

How do I change timezone in a docker container?

I'm running a docker container from docker-hub ...READ MORE

Jan 5, 2023 in DevOps on Cloud by Damonlang
• 1,230 points
748 views
+1 vote
3 answers
0 votes
2 answers

Configure Subdomains, Nginx-proxy and Docker-compose

If you are already using docker-compose I ...READ MORE

answered Aug 3, 2018 in DevOps on Cloud by Nilesh
• 7,060 points
8,545 views
0 votes
1 answer
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,100 points
2,653 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP