catalogs
1.2 How Docker Solves the Problem of Differing Development, Test, and Production Environments
1.3 Difference between Docker and Virtual Machines
Second, Docker installation (Windows version)
I. Introduction
1.1 How does Docker solve the problem of complex dependencies and compatibility of different component dependencies in large projects?
- Docker allows development to package applications, dependencies, libraries, and configurations together to form portable images
- Docker applications run in containers and are isolated from each other using a sandboxing mechanism
1.2 How Docker Solves the Problem of Differing Development, Test, and Production Environments
- The Docker image contains the complete runtime environment, including system libraries, and relies only on the Linux kernel, so it can be run on any Linux operating system.
1.3 Difference between Docker and Virtual Machines
docker implementation to run and deploy on different linux operating systems
- docker is a system process; a virtual machine is an operating system within an operating system
- Docker is small, fast to boot, and has good performance; VMs are large, slow to boot, and have mediocre performance
1.4 Docker Architecture
Image: Docker packages the application and its required dependencies, libraries, environments, configurations, and other files together into an image (that is, a file on the hard disk)
Container (Container): the process formed after running the application in the image is the container, but Docker will give the container to do isolation, not visible to the outside world.
Containers can read data from mirrors, but cannot write
So how will the MYSQL container write data in the future?
Make a copy of data to your own separate filesystem and write to your own place when writing data (same principle for logging, mirroring will not be disturbed or affected)
DockerHub: DockerHub is a platform for hosting Docker images, such a platform is called Docker Registry
Docker is a CS-architected program that consists of two parts
- Server: Docker daemon, responsible for handling Docker commands, managing images, containers, etc.
- Client: Sends commands to the Docker server via commands or RestAPI. You can send commands to the server locally or remotely.
1.5 Summary
Docker is a technology for rapidly delivering applications and running them:
- The program and its dependencies and runtime environment can be packaged together into an image that can be migrated to any Linux operating system.
- The sandbox mechanism is utilized to form an isolated container at runtime, so that each application does not interfere with each other.
- Startup and removal can be done with a single line of command, making it quick and easy.
Second, Docker installation (Windows version)
2.1 Preparing the environment
As for why use the Windows version, I think the use of virtual machines is too much trouble, and download the virtual machine to install a variety of systems take up a lot of space, the main thing is that my virtual machine can not be installed at all is very annoying, he has a bad impression!
Requirements: 1. Must be running Windows 10 version 2004 and higher or Windows 11
2. Turn on the virtualization at the location shown below, which is usually turned on, it is better to take a look at it as a precautionary measure
Launch a command window as an administrator and type: wsl –install
It may download very slowly, wait patiently, try not to let him midway terminal (keep the network good), if you look at a long time did not move, you can press a few times to try the return
Installation completed
Remember to restart your computer!!!
Administrator again open the command window and enter the following command
wsl --install -d Ubuntu
It may be a little slow, so if you don’t get a response for a long time, just go back to the car.
Enter your username and password (I had a little accident entering my username and password here)
Username:zhangjingqi
Password: 123456 (will not be displayed when you enter the password, just grasp it yourself)
2.2 Docker Installation
Web site:
https://desktop.docker.com/win/stable/Docker%20Desktop%20Installer.exe
Double-click to run after the download is complete
The following figure means to add desktop shortcuts, you can add or not, depending on personal preferences, and then click OK!
The following prompts to install successfully, restart the computer, click on the blue just
Forced acceptance of terms
The following screen appears to indicate that the installation was successful
2.3 Modifying the mirror
{
"registry-mirrors" : [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://cr.console.aliyun.com",
"https://mirror.ccs.tencentyun.com"
],
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
}
}
Keep spinning and spinning. Just wait a while. No more spinning.
Third, install portanier (visualization of the Docker operation page)
docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest
The picture below shows the finished installation, just go to this step
Enter localhost:9433 in the URL, and the following page will appear, then click Advanced to continue the visit.
And then this happened.