What is Docker?

 

Docker basics and its terminology


What is Docker?

  1. Docker is an open-source project for automating the deployment of applications as portable, self-sufficient containers that can run on the cloud or on-premises. 
  2. Docker is also a company that promotes and evolves this technology, working in collaboration with cloud, Linux, and Windows vendors, including Microsoft.
  3. In a container-based approach, the host operating system’s kernel and resources are directly shared by the containers through the Docker daemon. 
  4. This means that the containers are far more lightweight than a virtual machine, meaning you can run far more of those on the same amount of hardware.

Docker Terminologies

Container image:

  • A package with all the dependencies and information needed to create a container. 
  • An image includes all the dependencies (such as frameworks) plus deployment and execution configuration to be used by a container runtime. 
  • Usually, an image derives from multiple base images that are layers stacked on top of each other to form the container’s filesystem. An image is immutable once it has been created.
  • Starting with Sitecore version 10.0, container images for all roles and topologies are available at scr.sitecore.com, the Sitecore Container Registry (SCR)

Dockerfile

  • A text file that contains instructions for building a Docker image. 
  • It’s like a batch script, the first line states the base image, to begin with, and then follows the instructions to install required programs, copy files, and so on until you get the working environment you need.

Build 

  • The action of building a container image based on the information and content provided by its Dockerfile, plus additional files in the folder where the image is built.

Container

  • An instance of a Docker image. A container represents the execution of a single application, process, or service.
  • It consists of the contents of a Docker image, an execution environment, and a standard set of instructions. 
  • When scaling a service, you create multiple instances of a container from the same image. Or a batch job can create multiple containers from the same image, passing different parameters to each instance.

Volumes

  • Offer a writable filesystem that the container can use. Since images are read-only but most programs need to write to the filesystem, volumes add a writable layer, on top of the container image, so the programs have access to a writable filesystem. 
  • The program doesn’t know it’s accessing a layered filesystem, it’s just the filesystem as usual. Volumes live in the host system and are managed by Docker.

Tag

  • A mark or label you can apply to images so that different images or versions of the same image (depending on the version number or the target environment) can be identified.

Repository (repo)

  • A collection of related Docker images, labeled with a tag that indicates the image version. Some reports contain multiple variants of a specific image, such as an image containing SDKs (heavier), an image containing only runtimes (lighter), etc. 
  • Those variants can be marked with tags. A single repo can contain platform variants, such as a Linux image and a Windows image.

Registry

  • A service that provides access to repositories. The default registry for most public images is Docker Hub (owned by Docker as an organization). A registry usually contains repositories from multiple teams. 
  • Companies often have private registries to store and manage images they’ve created. Azure Container Registry is another example.

Docker Hub

  • A public registry to upload images and work with them. 
  • Docker Hub provides Docker image hosting, public or private registries, build triggers and webhooks, and integration with GitHub and Bitbucket.

For more details, you can refer to https://doc.sitecore.com/en/developers/100/developer-tools/containers-in-sitecore-development.html

References:

https://doc.sitecore.com/en/developers/100/developer-tools/containers-in-sitecore-development.html

https://docs.microsoft.com/en-us/dotnet/architecture/microservices/container-docker-introduction/docker-terminology

Comments