Intro To Docker

By Eric Moynihan

Want to install it?

Go to docs.docker.com/get-docker/

What is Docker?

Docker allows you to build and run containers.

What are containers?

Containers provide isolation of resources to a program such as:

  • Networking
  • Storage
  • CPUs

Images

An image is a virtual disk that you provide to docker in order to run a container.

You can get many images such as Ubuntu, Python, etc

Pulling from hub.docker.com

Creating/Running a container

A container must be created from an image.

Images on your local machine can be found with docker image ls

Images can be used by calling their name:label or by calling their ID directly

Listing containers

Docker-ising a discord bot

Volumes

Bind Mount

Maps a directory in your container to a directory on your computer.

Volume

Creates a virtual filesystem that's stored within docker that is mapped to a directory in one or more containers.

tmpfs mount

In memory mount for data that will be lost when the container stops.

Mapping to dev container

Docker Compose Overview