Jared Chu
Jared Chu

Reputation: 2852

Docker run normally but docker ps show nothing

docker run not working on my machine (Ubuntu 16.04).

enter image description here

Upvotes: 9

Views: 19960

Answers (3)

smaqsood
smaqsood

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

rettenda
rettenda

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

character
character

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

Related Questions