Docker Intro: Essential Commands Crash Course

Docker Intro: Essential Commands Crash Course

July 26, 2022
Tags:
docker

We'll cover the common docker commands. These are good to learn when you first get started with Docker. It's also a great refresher if you're already experienced with Docker.

Lifecycle Commands

docker run    # starts a new container
docker ps     # shows running containers
docker exec   # hops or "ssh" into a container
docker stop   # stops a container
docker rm     # removes a stopped container
docker start  # start back up a stopped container

Registry Commands

docker build  # builds an image from a Dockerfile
docker images # lists the pulled or built images
docker push   # pushes the image to a docker registry

Cleanup Commands

docker rm `docker ps -a -q`
docker rm $(docker ps -a | grep 'Exited' | awk '{print $1}')
docker rmi $(docker images | grep MYNAME_ | awk '{print $3}')

Commands from the Video

docker run --rm -ti boltops/docker-tutorial bash
docker run --rm -P -d boltops/docker-tutorial
docker ps
docker ps -a
docker exec -ti beautiful_diffie bash 
docker rm beautiful_diffie
docker start thirsty_chatelet 
docker stop thirsty_chatelet 
docker build -t boltops/docker-tutorial:latest .
docker images
docker push boltops/docker-tutorial:latest    
docker rm $(docker ps -a -q)
docker rm $(docker ps -a | grep 'Exited' | awk '{print $1}')
docker rmi $(docker images | grep MYNAME_ | awk '{print $3}')

Explore lesson as part of a learning path

Get full access to these great resources

All for less than the price of coffee a day

38 courses
274 lessons
44+ hours

Get started with BoltOps Learn now and get access to easy and powerful lessons

BoltOps Tools