If I spin up a Docker container with:
docker run -it ubuntu /bin/bash
and then exit. I can see the container using
docker ps -a
However, if I try and restart the container with
docker start <container ID>
I just get echoed back and returned to the command prompt.
What am I missing?
After running docker start <container ID>
to restart the container try running a docker ps
to ensure it's actually running.
If it IS running and you want to run commands on a bash shell from within the container, you can run the below command. In your case it would be :
docker exec -it <container ID> bash
use docker start with '-ai' so it attaches to container interactively
docker start -ai <container ID>
CAUTION! This will relaunch the process that this container is supposed to run:
CMD
instruction, then it will run it.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