Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker run normally but docker ps show nothing

Tags:

docker

ubuntu

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

enter image description here

like image 812
Jared Chu Avatar asked Dec 11 '22 10:12

Jared Chu


2 Answers

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.

like image 159
rettenda Avatar answered Dec 13 '22 01:12

rettenda


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

like image 35
Seonggwon Yoon Avatar answered Dec 13 '22 00:12

Seonggwon Yoon