How to restart a stopped docker container

0 votes

I use the following command to start a docker container from an image:

$ docker run -d myimage /bin/bash -c "mycommand"

The container is stopped (I assume it is stopped) after "mycommand" is finished, but it is not removed, because I can see it with this command:

$ docker ps -a

Is there a way to restart this container with the same parameters and maintain the data that mycommand generated?

Apr 30, 2022 in Docker by Abhijeet
• 180 points

edited 5 days ago 6 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.
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