×
☰ See All Chapters

Docker Terms

Dockerfile

A Dockerfile is simply a plain text file that contains a set of user-defined commands, which when executed by the docker image build

Command to build the docker image. To build an image from an application a Dockerfile is needed. The purpose of the Dockerfile is to automate the image building process, in which all the necessary dependencies and libraries are installed. Learn more about docker file form here Dockerfile.

Dockerimage

  • Dockerimage is the immutable snapshot of the software with its runtime environment. This can be run in container at any time later. 

  • Every image has a unique ID. 

  • Every image has base image, the base image does not have any parent. Base Docker image represents an operating system, and in the case of Linux, the base image can be one of its distributions, such as Debian, Alpine Linux. 

  • You can also download the Docker images that the other people have already created and add additional modules to the base image deriving the various images that can exhibit the preferred behavior. 

Docker layer

Images are typically of the read-only type. Each change that is made to the original image is stored in a separate layer. The original image and each pre-existing layer remain unchanged. Each layer will get a unique ID.

Docker container

Docker container is the top layer of image stack. This is the only top level layer which is read-write layer. There could be several read-only images beneath the container layer. When this top level container layer is started, Docker pulls the required image and its parent image. It continues to pull all the parent images until it reaches the base image.

docker-terms-0
 

Docker Registry and Repository

Docker repository is storage of docker registry. The registry is for registering the Docker images, whereas the repository is for storing those registered Docker images in a publicly discoverable and centralized place. A Docker Registry is a place where the Docker images can be stored in order to be publicly found, accessed, and used by the.

You can compare this with Git and GitHub.  Git is a repository and GitHub is a registry. Git repository is storage of GitHub registry. You can also host Git repository in Bitbucket, Gitlab registries.

Registry

A service responsible for hosting and distributing images. The default registry is the Docker Hub.

Examples of docker registry:

  • Docker Hub 

  • Quay 

  • Google Container Registry 

  • AWS Container Registry 

Repository

Docker repository is a collection of different docker images with same name that have different tags. Tag is alphanumeric identifier of the image within a repository.

Docker Hub Registry

  • Docker Hub is the public default registry. 

  • docker pull command will download the images form Docker Hub registry. 

  • https://index.docker.io/ is the docker hub registry URL. 

  • This registry has images contributed by Docker community and third parties. You can also contribute your image to public. 

  • If any image you want download form other registry you should specify the registry URL in the pull command. Following is an example of pulling an image from a third party repository hub: 

docker pull registry.example.com/myapp

Searching Docker images in Docker Hub Registry

  • When you are creating image, instead of building it from scratch you can use any available images from docker hub registry as base image can add additional modules to the base image deriving the various images that can exhibit the preferred behavior. 

  • You can search the available images that best fit your need. Use docker search subcommand to search in registry.  

Example: docker search oracle

docker-terms-1
 

Search images are ordered based on their star rating.

 

 


All Chapters
Author