Intermediate Docker Commands

Intermediate Docker

Mike Metzger

Data Engineering Consultant

Docker refresher

  • Docker is a container runtime
  • Is designed to run and manage various containerized applications on Windows, Mac, and Linux
  • Can run containers using pre-built images, or create our own
  • Dockerfiles are text files used to Docker container images
  • Containers are instances of a given Docker image

The DataCamp Introduction to Docker course is a pre-requisite to this course

Introduction to Docker course screenshot

Intermediate Docker

Docker commands

  • docker run
  • docker stop
  • docker build
  • docker --help
    • Provides a list of potential Docker commands
  • docker COMMAND --help
    • docker run --help
      • Provides options for the docker run command
Intermediate Docker

Temporary containers

  • Docker containers are usually created with docker run
  • Containers remain even after stopping / exiting
  • Often want to run a container instance and remove it immediately upon exit
    • Development
    • Testing
    • Scripts
  • docker run --rm
    • docker run --rm alpine:latest /bin/sh
  • Referenced as 'clean-up' or 'remove'
Intermediate Docker

docker ps

  • Used for determining name, id, status, and other attributes of containers on a given machine running Docker
  • Use the -a flag to get more information about existing containers
    • docker ps -a
  • Will cover how to get extremely detailed information about containers later in the course

docker ps -a

Intermediate Docker

Let's practice!

Intermediate Docker

Preparing Video For Download...