What is Docker?
Use Docker with IBM Cloud Subscribe for cloud updates
Illustration with collage of pictograms of computer monitor, server, clouds, dots
What is Docker?

Docker is an open source platform that enables developers to build, deploy, run, update and manage containers—standardized, executable components that combine application source code with the operating system (OS) libraries and dependencies required to run that code in any environment.

Containers simplify development and delivery of distributed applications. They have become increasingly popular as organizations shift to cloud-native development and hybrid multicloud environments. It’s possible for developers to create containers without Docker, by working directly with capabilities built into Linux and other operating systems. But Docker makes containerization faster, easier and safer. At this writing, Docker reported over 13 million developers using the platform (link resides outside ibm.com).

Docker also refers to Docker, Inc. (link resides outside ibm.com), the company that sells the commercial version of Docker. It also relates to the Docker open source project to which Docker, Inc and many other organizations and individuals contribute.

Strategic app modernization drives digital transformation

Strategic application modernization is one key to transformational success that can boost annual revenue and lower maintenance and running costs.

Related content

Register for the guide on hybrid cloud

How containers work and why they're so popular

Containers are made possible by process isolation and virtualization capabilities built into the Linux kernel. These capabilities include control groups (Cgroups) for allocating resources among processes and namespaces for restricting a process's access or visibility into other resources or areas of the system.

They enable multiple application components to share the resources of a single instance of the host operating system. This sharing is much the same way that a hypervisor enables multiple virtual machines (VMs) to share the CPU, memory and other resources of a single hardware server. 

As a result, container technology offers all the functionality and benefits of VMs—including application isolation, cost-effective scalability and disposability—plus important additional advantages:

  • Lighter weight: Unlike VMs, containers don’t carry the payload of an entire OS instance and hypervisor. They include just the OS processes and dependencies necessary to execute the code. Container sizes are measured in megabytes (versus gigabytes for some VMs), make better use of hardware capacity and have faster startup times. 

  • Improved developer productivity: Containerized applications can be written once and run anywhere. And compared to VMs, containers are faster and easier to deploy, provision and restart. This advantage makes them ideal for use in continuous integration and continuous delivery (CI/CD) pipelines and a better fit for development teams adopting agile and DevOps practices.

  • Greater resource efficiency: With containers, developers can run several times as many copies of an application on the same hardware as they can using VMs. This efficiency can reduce cloud spending.

Companies using containers report other benefits including improved app quality, faster response to market changes and much more. Learn more with this interactive tool: 

Download the full report: Containers in the enterprise
Why use Docker?

Docker is so popular today that “Docker” and “containers” are used interchangeably. But the first container-related technologies were available for years—even decades (link resides outside ibm.com)—before Docker was released to the public in 2013. 

Most notably, in 2008, LinuXContainers (LXC) was implemented in the Linux kernel, fully enabling virtualization for a single instance of Linux. While LXC is still used today, newer technologies using the Linux kernel are available. Ubuntu, a modern, open source Linux operating system, also provides this capability. 

Docker lets developers access these native containerization capabilities using simple commands and automate them through a work-saving application programming interface (API). Compared to LXC, Docker offers:

  • Improved and seamless container portability: While LXC containers often reference machine-specific configurations, Docker containers run without modification across any desktop, data center and cloud environment. 
  • Even lighter weight and more granular updates: With LXC, multiple processes can be combined within a single container. This flexibility makes it possible to build an application that can continue running while one of its parts is taken down for an update or repair. 

     

  • Automated container creation: Docker can automatically build a container based on application source code. 

     

  • Container versioning: Docker can track versions of a container image, roll back to previous versions and trace who built a version and how. It can even upload only the deltas between an existing version and a new one. 

     

  • Container reuse: Existing containers can be used as base images—essentially like templates for building new containers. 

     

  • Shared container libraries: Developers can access an open source registry containing thousands of user-contributed containers. 

Today Docker containerization also works with Microsoft Windows and Apple MacOS. Developers can run Docker containers on any operating system. Most leading cloud providers, including Amazon Web Services (AWS), Microsoft Azure and IBM Cloud® offer specific services to help developers build, deploy and run applications containerized with Docker.

Docker tools and terms

Some of the tools, terms and technologies developers encounter when using Docker include: 

Dockerfile

Every Docker container starts with a simple text file containing instructions for how to build the Docker container image. Dockerfile automates the process of Docker image creation. It’s essentially a list of command-line interface (CLI) instructions that Docker Engine will run in order to assemble the image. The list of Docker commands is huge, but standardized: Docker operations work the same regardless of contents, infrastructure or other environment variables. 

Docker images

Docker images contain executable application source code as well as all the tools, libraries and dependencies that the application code needs to run as a container. When you run the Docker image, it becomes one instance (or multiple instances) of the container. 

It’s possible to build a Docker image from scratch, but most developers pull them down from common repositories. Multiple Docker images can be created from a single base image and they’ll share the commonalities of their stack. 

Docker images are made up of layers and each layer corresponds to a version of the image. Whenever a developer makes changes to the image, a new top layer is created and this top layer replaces the previous top layer as the current version of the image. Previous layers are saved for rollbacks or to be re-used in other projects. 

Each time a container is created from a Docker image, yet another new layer called the container layer is created. Changes made to the container—such as the addition or deletion of files—are saved to the container layer and exist only while the container is running.

This iterative image-creation process enables increased overall efficiency since multiple live container instances can run from just a single base image and when they do so, they leverage a common stack. 

Docker containers

Docker containers are the live, running instances of Docker images. While Docker images are read-only files, containers are live, ephemeral, executable content. Users can interact with them and administrators can adjust their settings and conditions using Docker commands. 

Docker Hub

Docker Hub (link resides outside ibm.com) is the public repository of Docker images that calls itself the “world’s largest library and community for container images.” It holds over 100,000 container images sourced from commercial software vendors, open source projects and individual developers. It includes images that have been produced by Docker, Inc., certified images belonging to the Docker Trusted Registry and thousands of other images. 

All Docker Hub users can share their images at will. They can also download predefined base images from the Docker filesystem to use as a starting point for any containerization project. 

Other image repositories exist, as well, notably GitHub. GitHub is a repository hosting service, well known for application development tools and as a platform that fosters collaboration and communication. Users of Docker Hub can create a repository (repo) which can hold many images. The repository can be public or private and can be linked to GitHub or BitBucket accounts. 

Docker Desktop

Docker Desktop (link resides outside ibm.com) is an application for Mac or Windows that includes Docker Engine, Docker CLI client, Docker Compose, Kubernetes and others. It also includes access to Docker Hub. 

Docker daemon

Docker daemon is a service that creates and manages Docker images, using the commands from the client. Essentially the Docker daemon serves as the control center of your Docker implementation. The server on which Docker daemon runs is called the Docker host.

Docker registry

Docker registry is a scalable open source storage and distribution system for Docker images. The registry enables you to track image versions in repositories, using tagging for identification. This tracking and identification is accomplished using Git, a version control tool. 

Docker deployment and orchestration

When running just a few containers, it’s fairly simple to manage an application within Docker Engine, the industry de facto runtime. But for deployments comprising thousands of containers and hundreds of services, it’s nearly impossible to manage the workflow without the help of some purpose-built tools.

Docker plug-ins

Docker plug-ins (link resides outside ibm.com) can be used to make Docker even more functional. Several Docker plug-ins are included in the Docker Engine plug-in system and third-party plug-ins can be loaded as well. 

Docker Compose

Developers can use Docker Compose to manage multi-container applications, where all containers run on the same Docker host. Docker Compose creates a YAML (.YML) file that specifies which services are included in the application and can deploy and run containers with a single command. Because YAML syntax is language-agnostic, YAML files can be used in programs written in Java, Python, Ruby and many other languages. 

Developers can also use Docker Compose to define persistent volumes for storage, specify base nodes and document and configure service dependencies. 

Kubernetes

Monitoring and managing container lifecycles in more complex environments requires a container orchestration tool. While Docker includes its own orchestration tool (called Docker Swarm), most developers choose Kubernetes instead. 

Kubernetes is an open source container orchestration platform descended from a project developed for internal use at Google. Kubernetes schedules and automates tasks integral to the management of container-based architectures, including container deployment, updates, service discovery, storage provisioning, load balancing, health monitoring and more.

In addition, the open source ecosystem of tools for Kubernetes, including Istio and Knative, enables organizations to deploy a high-productivity platform-as-a-service (PaaS) for containerized applications. This ecosystem also provides a faster on-ramp to serverless computing.

Learn more about Kubernetes

Related solutions
Red Hat® OpenShift® on IBM Cloud®

Explore how Red Hat OpenShift on IBM Cloud leverages Red Hat OpenShift in public and hybrid environments for velocity, market responsiveness, scalability and reliability.

Explore Red Hat OpenShift on IBM Cloud
IBM Cloud Satellite® 

Leverage IBM Cloud Satellite to start consistent cloud services anywhere—on premises, at the edge and in public cloud environments.

Explore IBM Cloud Satellite
Hybrid cloud storage solutions

Store data where it makes the most sense for applications and services with IBM hybrid cloud storage solutions across on-premises, private and public cloud.

Explore hybrid cloud storage solutions
Cloud services

See how a managed cloud services approach helps mitigate potential tension between traditional IT management and DevOps culture.

Explore cloud services
Resources Containers in the enterprise

Read new IBM Research® about the surging momentum of container and Kubernetes adoption.

Serve models on Kubernetes or OpenShift using stand-alone containers

Build a stand-alone container image to serve IBM Watson® NLP models and then run it on a Kubernetes or Red Hat OpenShift cluster.

Take the next step

Red Hat OpenShift on IBM Cloud offers developers a fast and secure way to containerize and deploy enterprise workloads in Kubernetes clusters. Offload tedious and repetitive tasks involving security management, compliance management, deployment management and ongoing lifecycle management. 

Explore Red Hat OpenShift on IBM Cloud Start for free