Introducing Containers


  • Almost all software depends on other software components to function, but these components have independent evolutionary paths.
  • Small environments that contain only the software that is needed for a given task are easier to replicate and maintain.
  • Critical systems that cannot be upgraded, due to cost, difficulty, etc. need to be reproduced on newer systems in a maintainable and self-documented way.
  • Virtualization allows multiple environments to run on a single computer.
  • Containerization improves upon the virtualization of whole computers by allowing efficient management of the host computer’s memory and storage resources.
  • Containers are built from ‘recipes’ that define the required set of software components and the instructions necessary to build/install them within a container image.
  • Docker is just one software platform that can create containers and the resources they use.

The Docker Hub


  • The Docker Hub is an online repository of container images.
  • Many Docker Hub container images are public, and may be officially endorsed.
  • Each Docker Hub page about a container image provides structured information and subheadings
  • Most Docker Hub pages about container images contain sections that provide examples of how to use those container images.
  • Many Docker Hub container images have multiple versions, indicated by tags.
  • The naming convention for Docker container images is: OWNER/CONTAINER_IMAGE_NAME:TAG

Docker Desktop


  • Docker Desktop is a great dashboard that allows us to understand and visualize the lifecycle of images and containers.
  • Images are snapshots of an environment, easily distributable and ready to be used as templates for containers.
  • Containers are executions of the images, often with configuration added on top, and usually meant for single use.
  • Running a container usually implies creating a new copy, so it is important to clean up regularly.
  • Docker Desktop could potentially be all you need to use if you only consume images out of the box.
  • However, it is very limited in most cases (even for consumers), and rarely allows the user to configure and interact with the containers adequately.

Using the Docker command line


  • asdf
  • asdf
  • asdf

Creating Your Own Container Images


  • Dockerfiles specify what is within Docker container images.
  • The docker image build command is used to build a container image from a Dockerfile.
  • You can share your Docker container images through the Docker Hub so that others can create Docker containers from your container images.

Creating More Complex Container Images


  • Docker allows containers to read and write files from the Docker host.
  • You can include files from your Docker host into your Docker container images by using the COPY instruction in your Dockerfile.