Docker Tutorial for Beginners

YouTube Link


sudo docker run docker/whalesay cowsay Hello-World!

Kawaii! (✿◠‿◠)

Docker Commands


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

Ubuntu Example

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

Executing a command

docker exec distracted_mcclintock cat /etc/hosts