Getting Started with Docker

docker logo

If you’re into DevOps, Docker is one of those tools you’ll encounter sooner or later. It’s pretty awesome. But getting started with it can be a tad difficult, so I’m here to help with that.

I’ve been on a bittersweet honeymoon with Docker, and there are certainly things I wish I’d known about when I first started out. One of the greatest benefits of learning from the Internet is the massive amount of information that is available. One of the greatest downsides? The massive amount of information that is available.

A downside of learning things on your own is that there is just so much content out there, but it’s up to you to organize and process it all into something you can understand….and sometimes, after banging your head against the wall to figure out a strange bug, you realize that the information is outdated!

So in this post, I’ll give a quick and simple introduction of Docker, what it is capable of, and how you can get started with it as of Docker version 1.9.0.

Table of Contents

  1. Applications of Docker
  2. The Problem
    1. Virtualization: Development Environment = Production Environment
    2. Configuration Management: Development Configuration = Production Configuration
  3. Docker: Containerization vs. Virtualization + Configuration Management
    1. Containers
    2. Terminology
  4. Getting Started
    1. Docker Daemon/Server
      1. Linux
      2. Mac/Windows
    2. Images
    3. Containers
    4. Remote API
  5. Wrapping Up
  6. References and Further Reading

Applications of Docker

There is no such thing as a tool that can do everything, and there is no magical panacea that can solve all of our problems. Docker is no different. Like any tool, there are some use cases that better suit it, and other situations when it is ill suited. You wouldn’t use a hammer to dig a hole, or a shovel to screw a nail. Whenever you learn a new tool, instead of thinking, “Hey, I wonder if I can use it to do ____?” a better question to ask would be “What is this tool best suited for?”

Applications of Docker that really make it shine include using it for:

  • Ephemeral (temporary) isolated processes (e.g. Codepen, Codeship)
  • Short running tasks, maintenance scripts, or worker processes that receive then process a workload
  • Running and deploying stateless applications
    • Web frontends
    • Backend APIs
  • Running isolated environments with imposed CPU/memory limits

However, because of the ephemeral nature of Docker containers, it is not a great choice for applications that need to store state/files, though it is possible to mount folders/volumes from the Docker host into the container. Continue reading “Getting Started with Docker”