Reputation: 2852
docker run
not working on my machine (Ubuntu 16.04).
Upvotes: 9
Views: 19960
Reputation: 1889
docker run -dit ubuntu
docker exec -it ubuntu bash
OR
docker run -dit ubuntu bash
Above is the basic command. You can add ports and volumes to it as per need.
Upvotes: 1
Reputation: 385
It's likely docker run
did work, but since you did not specify any command to run, the container stopped working just after starting. With docker ps -a
you should see some exited ubuntu containers.
If you run the container as daemon (-d
) and tell it to wait for interactive input (-it
) it should stay running. Hence docker run -d -it ubuntu
should do what you want.
Upvotes: 11
Reputation: 310
I did not understand the question correctly. What you want to do is bash connection maybe parameter to execute is incorrect
sudo docker run -t -i /bin/bash ubuntu
Go for it
Upvotes: 3