It’s a good question, and before you know the answer, Docker images can seem pretty mysterious. Not only do I want to give you the answer, but I want to show you how I got there. Let’s start at the beginning.
Hopefully you’re all familiar with a Dockerfile – the instructions on how Docker will build an image for you. Here’s a simple example. Each of these lines are instructions to Docker on how to build an image.
It will use ubuntu:15.04 as the base and then copy in a python script. The CMD instruction is a directive on what to do when you run the container (turn the image into a running process), and therefore not relevant at this stage.
Source: cameronlonsdale.com