Container (2), Docker

This series of articles is about Docker, or Container, due to I cannot get the suitable category, so I designate it to DevOps because the container is used for CI/CD (Continuous Integration and Continue Deployment).

Introduction

Contents of this article:

  • A - Introduction
  • B - Container
  • C - What is Docker
  • D - Docker Desktop Installation in Windows 11
    • Docker Desktop
    • Docker Desktop Installation
    • Dealing with WSL 2
  • E - Major Features of Docker

B - Container

Containerization is operating system-level virtualization or application-level virtualization over multiple network resources so that software applications can run in isolated user spaces called containers in any cloud or non-cloud environment, regardless of type or vendor.[ref]

Usage

The containers are basically a fully functional and portable cloud or non-cloud computing environment surrounding the application and keeping it independent from other parallelly running environments. Individually each container simulates a different software application and runs isolated processes by bundling related configuration files, libraries, and dependencies. But, collectively, multiple containers share a common OS Kernel.

The containerization technology has been vastly adopted by cloud computing platforms like 

Types of containers

C - Docker

Docker is a set of the platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers The software that hosts the containers is called Docker Engine. It was first started in 2013 and is developed by Docker, Inc.

Docker is a tool used to automate the deployment of applications in lightweight containers so that applications can work efficiently in different environments.

Background

Containers are isolated from one another and bundle their own software, libraries, and configuration files; they can communicate through well-defined channels. Because all containers share the services of a single operating system kernel, they use fewer resources than virtual machines.

Operation

Docker can use different interfaces to access the virtualization features of the Linux kernel.

Docker can package an application and its dependencies in a virtual container that can run on any Linux, Windows, or macOS computer. This enables the application to run in a variety of locations, such as 

When running on Linux, Docker uses the resource isolation features of the Linux kernel and a union-capable file system to allow containers to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines. Docker on macOS uses a Linux virtual machine to run the containers.

Because Docker containers are lightweight, a single server or virtual machine can run several containers simultaneously. 

D - Docker Installation in Windows 11

 

Docker Desktop

Docker Desktop is a desktop GUI management tool for Docker in Mac, Linux, or Windows environments to manage containers, applications, and images directly from your machine. 

Docker Desktop Installation

Following the instruction from Install Docker Desktop on Windows.

1, Install WSL 2 Backend

Because the WSL 2 backend is recommended and preferred, so we install WSL first by run (see details in Container (1), WSL):

wsl --install

2, Download the Docker Desktop exe file

On the instruction page, click the button as shown below:

3, Installation

Use the default: WSL 2

Installation ongoing,

Done, Close, and restart.

4, Initialization

Fill out the info, then go through the tutorial:

Clone:

Build.

Run.

Share.

Dealing with WSL 2

It seemed to me previously the Docker Desktop is a GUI to manage Docker. Even though I did not install the Docker Desktop, it still was installed associated with other software installations. For example, with Visual Studio 2019. In my personal experience, I have one computer installed with Visual Studio 2019, and the Docker Desktop is installed. However, another computer has Visual Studio 2022 installed, the Docker desktop is not installed. I do not know if a different version of Visual Studio or Docker causes the difference.

See the layouts for the different version of Docker Desktop are different:


Old version: 4.8.1 (05.2022)


Current version: 4.17.0

There were possible issues when you installed Docker Desktop with other software without first installing WSL 2.

Suppose you do not have a Docker Desktop installed and do not install WSL manually before the Docker desktop installation when you start the Docker after Installation. In that case, you might get the warning message:

Install WSL | Microsoft Learn

After installing WSL:

It would be best to realize no Linux distribution is installed except the Docker-desktop-data and docker-desktop. The same is true if you have a Docker Desktop installed previously associated with other software, say, Visual Studio 2019.

In this situation, when we run Docker Desktop, we probably need at least one Linux distribution. Now we

Install a Linux distribution: by command below, say, for distribution ubuntu:

WSL --install -d ubuntu

The installation processing in another Prompt:

E - Major Features of Docker

Images.

Containers (empty).

Containers.

Volumes.

Dev Environments.

Extensions.

References

Deployment of Microservice to Docker

Related Info


Similar Articles