Everything You Need To Know About Docker

Everything You Need To Know About Docker

In this article, we will explains different parts of Docker in a very simple and straightforward way.

“Everything You Need To Know About Docker” is a series of articles (so far 6) that explains different parts of *Docker *in a very simple and straightforward way. Here are the parts so far:

  • Docker concepts (Part 1): The Conceptual Landscape (You are here)
  • Docker ecosystem (Part 2): A Delicious Dozen Docker Terms You Need to Know
  • Dockerfile (Part 3): A Dozen Dandy Dockerfile Instructions
  • Slimming down Docker images (Part 4): Learn how to speed up your Docker build cycles and create lightweight images
  • Docker commands (Part 5): We’ll look at 15 Docker CLI commands you should know
  • Docker data (Part 6): Using data with Docker. In it, we’ll focus on Docker volumes.

    Docker concepts: The Conceptual Landscape

Containers are hugely helpful for improving security, reproducibility, and scalability in software development and data science. Their rise is one of the most important trends in technology today.

Docker is a platform to develop, deploy, and run applications inside containers. Docker is essentially synonymous with containerization. If you’re a current or aspiring software developer or data scientist, Docker is in your future.

Don’t fret if you aren’t yet up to speed — this article will help you understand the conceptual landscape — and you’ll get to make some pizza along the way.

In the next five articles in this series we’ll jump into Docker terms, Dockerfiles, Docker images, Docker commands, and data storage.

By the end of the series (and with a little practice) you should know enough Docker to be useful!

Docker Metaphors

First, I’m going to shed some light on Docker metaphors.

Google’s second definition for Metaphor is what we want:

Originally published by Jeff Hale at https://towardsdatascience.com Metaphors help us make sense of new things. For example, the metaphor of a physical container helps us quickly grasp the essence of a virtual container.

A physical container


Like a physical plastic container, a Docker container:

  1. *Holds things *— Something is either inside the container or outside the container.
  2. *Is portable *— It can be used on your local machine, your coworker’s machine, or a cloud provider’s servers (e.g. AWS). Sort of like that box of childhood knickknacks you keep moving with you from home to home.
  3. Has clear interfaces for access — Our physical container has a lid for opening and putting things in and taking things out. Similarly, a Docker container has several mechanisms for interfacing with the outside world. It has ports that can be opened for interacting through the browser. You can configure it to interact with data through the command line.
  4. *Can be obtained from a remote location *— You can get another empty plastic container from Amazon.com when you need it. Amazon gets its plastic containers from manufacturers who stamp them out by the thousands from a single mold. In the case of a Docker container, an offsite registry keeps an image, which is like a mold, for your container. Then when you need a container you can make one from the image.

Unlike a virtual Docker container, a new plastic container from Amazon will cost you money and won’t come with a copy of your goods inside. Sorry 💸.

Living Instance

A second way you can think of a Docker container is as** an instance of a living thing**. An instance is something that exists in some form. It’s not just code. It’s code that has brought something to life. Like other living things, the instance will eventually die — meaning the container will shut down.

A Docker container is a Docker image brought to life.


In addition to the container metaphor and the living instance metaphor, you can think of a Docker container as a software program. After all, it is software. At its most basic level a container is a set of instructions that manipulate other bits.

Containers are code

While a Docker container is running, it generally has programs running inside it. The programs in a container perform actions so your application will do something.

For example, the code in a Docker container might have sent you the content you are reading on this webpage right now. Or it might take your voice command to Amazon Alexa and decode it into instructions another program in a different container will use.

With Docker you can run multiple containers simultaneously on a host machine. And like other software programs, Docker containers can be run, inspected, stopped, and deleted.


Virtual Machines

Virtual machines are the precursors to Docker containers. Virtual machines also isolate an application and its dependencies. However, Docker containers are superior to virtual machines because they take fewer resources, are very portable, and are faster to spin up.

Docker Image

I mentioned images above. What’s an image? I’m glad you asked! The meaning of the term image in the context of Docker doesn’t map all that well to a physical image.


Docker images are more like blueprints, cookie cutters, or molds. Images are the immutable master template that is used to pump out containers that are all exactly alike.

Cookie cutters

An image contains the Dockerfile, libraries, and code your application needs to run, all bundled together.


A Dockerfile is a file with instructions for how Docker should build your image.

The Dockerfile refers to a base image that is used to build the initial image layer. Popular official base images include python, ubuntu, and alpine.

Additional layers can then be stacked on top of the base image layers, according to the instructions in the Dockerfile. For example, a Dockerfile for a machine learning application could tell Docker to add NumPy, Pandas, and Scikit-learn in an intermediate layer.

Finally, a thin, writable layer is stacked on top of the other layers according to the Dockerfile code. (You understand that a thin layer is small in size because you intuitively understand the thin metaphor, right 😃?)

I’ll explore Dockerfiles in more depth in future articles in this series.

Docker Container

A Docker image plus the command docker run image_name creates and starts a container from an image.

Container Registry

If you want other people to be able to make containers from your image, you send the image to a container registry. Docker Hub is the largest registry and the default.

Phew! That’s a lot of pieces. Let’s put this all together in terms of making a pizza.

Cooking with Docker

Landscape Metaphor

  • The recipe is like the Dockerfile. It tells you what to do to get to your end goal.
  • The ingredients are the layers. You’ve got crust, sauce, and cheese for this pizza.

Think of the recipe and the ingredients combined as an all-in-one pizza-making-kit. It’s the Docker image.

The recipe (Dockerfile) tells us what we’re going to do. Here’s the plan:

  • The crust is preformed and immutable, it’s like a basic ubuntu parent image. It’s the bottom layer and gets built first.
  • Then you’ll add some cheese. Adding this second layer to the pizza is like *installing an external library *— for example NumPy.
  • Then you’ll sprinkle on some basil. The basil is like the code in a file that you wrote to run your app.

Alright, let’s get cooking.


  • The oven that bakes the pizza is like the Docker platform. You installed the oven into your house when you moved in so you could make things with it. Similarly, you installed Docker onto your computer so you could cook up containers.
  • You start your oven by turning a knob. The docker run image_name command is like your knob — it creates and starts your container.
  • The cooked pizza is like a Docker container.
  • Eating the pizza is like using your app.

Like making a pizza, making an app in a Docker container takes some work, but at the end you have something great. Enjoy 🍕!


That’s the conceptual framework. In Part 2 of this series I clarify some of the terms you’ll see in the Docker ecosystem. Follow me to make sure you don’t miss it!

Hopefully this overview has helped you better understand the Docker landscape. I also hope it has also opened your eyes to the value of metaphors in understanding new technologies.

If you found this helpful please share it on your favorite social media so other people can find it, too. 👏

docker devops kubernetes machine-learning data-science

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Most popular Data Science and Machine Learning courses — July 2020

Most popular Data Science and Machine Learning courses — August 2020. This list was last updated in August 2020 — and will be updated regularly so as to keep it relevant

15 Machine Learning and Data Science Project Ideas with Datasets

Learning is a new fun in the field of Machine Learning and Data Science. In this article, we’ll be discussing 15 machine learning and data science projects.

Using Docker and Kubernetes to Simplify Machine Learning

Using Docker and Kubernetes to Simplify Machine Learning: Managing the hardware, drivers, libraries and packages that make up a ML development environment can be hard. In this talk, I will introduce how Docker can be used to simplify the process of setting up a local ML development environment, and how we can use Kubernetes and Kubeflow to scale that standardised environment to provide scalable, web-based Jupyter environments for a large number of users, that can be served from both public cloud providers and from on-premise clusters.

50 Data Science Jobs That Opened Just Last Week

Data Science and Analytics market evolves to adapt to the constantly changing economic and business environments. Our latest survey report suggests that as the overall Data Science and Analytics market evolves to adapt to the constantly changing economic and business environments, data scientists and AI practitioners should be aware of the skills and tools that the broader community is working on. A good grip in these skills will further help data science enthusiasts to get the best jobs that various industries in their data science functions are offering.

Pipelines in Machine Learning | Data Science | Machine Learning | Python

Machine Learning Pipelines performs a complete workflow with an ordered sequence of the process involved in a Machine Learning task. The Pipelines can also