sudo docker run docker/whalesay cowsay Hello-World!
docker run nginx # start a container docker ps # lists containers docker ps -a # list all running or not docker stop [container_id] # get container id from docker ps docker rm [container_id] # remove container not just shut down.
docker images docker rmi [repo_repo] docker run [image_repo] # pulls it and runs it docker pull [image_repo] # pulls but doesn't run it
docker run ubuntu
It stops instantly. Applications are supposed to be run on it. It is used as a base image.
docker run ubuntu sleep 5
docker exec distracted_mcclintock cat /etc/hosts