Docker container will automatically stop after docker run -d

0 votes

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 in DevOps on Cloud by Damonlang
• 900 points
55 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 in DevOps on Cloud by David
• 220 points
107 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 in DevOps on Cloud by Damonlang
• 900 points
5 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,040 points
6,979 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
1,994 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