Windows installation Docker container tutorial

Windows installation Docker container tutorial

what is docker

I. Introduction

What is a Docker container

Docker containers are a lightweight, portable, self-contained software packaging and deployment technology. It can package the application and dependencies in a portable container and provide a consistent operating environment to ensure the reliability and stability of the application no matter which computer it runs on.
In a Docker container, an application and all its dependencies are packaged in a single container, this includes the operating system, libraries, application code and configuration, etc. Since all dependencies are packaged in a container, it can easily be run on any computer without any modifications to the target machine. This makes Docker containers a very convenient technology for packaging and deploying applications.
Compared with traditional virtualization technology, Docker container is a more lightweight and efficient virtualization technology. In the traditional virtualization technology, each virtual machine needs to independently run the operating system and application program, which will lead to waste of resources and degradation of performance. In a Docker container, multiple containers can share the same operating system kernel, which makes the container more lightweight and efficient.
Another advantage of Docker containers is their portability. Since a container contains an application and all dependencies, it can run on any computer that supports Docker. This allows containers to be easily deployed and migrated across development, test, and production environments.
In general, Docker container is a very convenient and efficient application packaging and deployment technology, which can provide a consistent operating environment, efficient resource utilization and portability, and has become an important tool in modern software development and deployment .

Advantages of Docker Containers

As a lightweight, portable, self-contained software packaging and deployment technology, Docker container has the following advantages:
Efficient resource utilization
Docker container utilizes operating system-level virtualization technology, and can run multiple Each virtual machine needs to run a complete operating system in traditional virtual machines. This can greatly save resources and improve server utilization.
Portability
Docker containers package an application and all its dependencies, including the operating system, libraries, application code and configuration, and more. This allows containers to run on any machine that supports Docker without any modifications. This portability is important for easily deploying applications from a development environment to a production environment, or deploying and migrating across multiple environments.
Simplify the Deployment Process
Docker containers provide a consistent operating environment, so applications can be easily packaged as a container and deployed in any environment that supports Docker. This greatly simplifies the deployment process, reduces problems and errors in deployment, and improves production efficiency.
Scalability
Docker containers support horizontal scaling by creating multiple identical containers to handle higher loads. When the load drops, redundant containers can also be easily removed. This allows applications to quickly adapt to varying load requirements.
High-reliability
Docker containers provide a consistent operating environment, avoiding problems with applications in different environments. In addition, the self-containment and portability of containers also ensure the reliability and stability of applications.

II. Use of Docker Containers

Docker is normally installed and used on a linux system, but we may want to experience and learn on our own computers. It would be cumbersome to use a virtual machine, and running a virtual machine would make our computer lag. The official also gives the windows version of docker. Let's look at the installation steps below.

Install Docker on Windows

On Windows systems, Docker uses Linux containers by default. If you need to use Windows containers, you can configure it in the settings of Docker Desktop.

It should be noted that in order to run Docker, the system needs to meet the following minimum requirements:
Windows 10 Professional version 1903 or newer
Hyper-V needs to be enabled
For older versions of Windows, Docker Toolbox needs to be used instead of Docker Desktop
Finally, wsl needs to be updated

The first step; open Hyper-V to enable the linux subsystem

Open the Control Panel
insert image description here
insert image description here
insert image description hereinsert image description here
and finally click OK to save and restart the computer.

In fact, the above steps are basically completed. Follow the prompts to install it.

Download Docker Desktop
Download Docker Desktop from the official website, you can download the latest version from the following link: https://www.docker.com/products/docker-desktop

Install Docker Desktop
After the download is complete, run the installer and follow the prompts to install it. During the installation process, you need to pay attention to selecting the Windows version, because Docker Desktop also provides a Mac version.
insert image description here

Start Docker Desktop
After the installation is complete, you can start Docker Desktop. Docker Desktop can be started with:
insert image description here

Search for Docker Desktop in the start menu and start it
Find the Docker Desktop icon in the system tray and click it
insert image description here

Verify that Docker is running correctly
You can verify that Docker is running correctly with the following command:

docker run hello-world

If Docker is running properly, you will see a welcome message indicating that Docker is successfully installed and running.

insert image description here
insert image description here

In general, installing Docker on a Windows system is relatively simple, you only need to download and install Docker Desktop to complete.

Guess you like

Origin blog.csdn.net/hjjshua/article/details/130520266