Docker in a nutshell

../_images/docker-in-a-nutshell.gif

Building and deploying new applications is faster with containers. Docker containers wrap up software and its dependencies into a standardized unit for software development that includes everything it needs to run: code, runtime, system tools and libraries. This guarantees that your application will always run the same and makes collaboration as simple as sharing a container image.

Images

  • An image is a template (snapshot / blueprint) with instructions for creating the environment you want

  • An image is immutable

  • An image can be saved (pushed) into a registry (docker hub)

  • To create your own image, you create a Dockerfile defining the steps needed to create the image and build it

Containers

  • A container is a runnable instance of an image

  • Images can be run on any machine with a docker daemon installed (portability) as containers if they have been build for the underlying platform / architecture

  • Multiple containers can be created based on the same image

  • Containers allow you to run an application in an isolated environment

  • Many containers can be run simultaneously on a given host

  • Containers run directly on the host machine’s kernel

Why docker - Containerization?

  • Why developers care

    • A clean, safe, hygienic and portable runtime environment

    • No worries about missing dependencies, packages, and other pain points.

    • Run each app in its own isolated container, so you can run various versions of libraries and other containers

    • You can revert to “older” versions like a snap

    • Automate testing, integration and packaging

    • Recyclable environment(s)

    • Reduce / eliminate concerns about compatibility on other platforms

    • Handy tool to have even without the above, just for developers (local development)

  • Why Ops care

    • Make the entire lifecycle more efficient, consistent, and repeatable

    • Increase the quality of code produced by developers

    • Eliminate inconsistencies between DTAP environments

    • Promote separation of concerns

    • Fallback to “working” version very easy

    • Significantly increase the speed and reliability for Continues Deployment and Integration

  • Why not VM

    • Speed of deployment

    • Portability

    • Density & Performance

    • Cost

    • Size

    • Less host machine resources used

../_images/docker-in-a-nutshell.jpg

Extra information

Let’s quickly start playing with the Docker CLI next…