In the last episode, you saw how simple it can be to download and run a Docker image. But what was the -p option about? And what was all that talk about “images”? Aren't Docker things supposed to be “containers”?
It turns out Docker uses images as a baseline for creating containers – the actual application instance. And in the process of using the “docker run” command over and over again, we accidentally created more container instances than maybe we should have.
In this episode, then, we'll explore the differences between an image and a container, we'll look at that -p option and what it does, and we'll name containers so that we can simply start and stop them when we need to. The end result will be an easier way to manage Docker containers, without having to remember which options you needed for the image, every time you want to run one.