


Code example sharing on how to install Docker on Windows
Download Docker for Windows
Stable version
Prepare to install Docker for Windows
Before installation, please ensure that the Windows 10 version is greater than or equal to 1703, and the os version is greater than or equal to 15063
I When installing under version 1607, there will be an error that the referenced assembly file cannot be found
The Hyper-V package must be enabled for Docker for Windows to work. If your system does not meet these requirements, you can install Docker Toolbox, which uses Oracle Virtual Box instead of Hyper-V.
Install Hyper-V on Windows 10 URL
Install Docker for Windows
Double-click InstallDocker.msi to run the installer.
Check Docker
Open PowerShell and enter the following code
PS C:\Users\Docker> docker --version Docker version 17.03.0-ce, build 60ccb22 PS C:\Users\Docker> docker-compose --version docker-compose version 1.11.2, build dfed245 PS C:\Users\Docker> docker-machine --version docker-machine version 0.10.0, build 76ed2a6
Run docker run hello-world to test pulling an image from Docker Hub and starting a container.
PS C:\Users\jdoe> docker run hello-world
Hello from Docker. This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: The Docker client contacted the Docker daemon. The Docker daemon pulled the "hello-world" image from the Docker Hub. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
Try something more ambitious and run an Ubuntu container using this command.
This will download the ubuntu container image and start it. Below is the output of running this command in powershell.
PS C:Usersjdoe> docker run -it ubuntu bash Unable to find image 'ubuntu:latest' locally latest: Pulling from library/ubuntu 5a132a7e7af1: Pull complete fd2731e4c50c: Pull complete 28a2f68d1120: Pull complete a3ed95caeb02: Pull complete Digest: sha256:4e85ebe01d056b43955250bbac22bdb8734271122e3c78d21e55ee235fc6802d Status: Downloaded newer image for ubuntu:latest
Use docker to open the nginx server
PS C:\Users\jdoe> docker run -d -p 80:80 --name webserver nginx
Unable to find image 'nginx:latest' locally latest: Pulling from library/nginx fdd5d7827f33: Pull complete a3ed95caeb02: Pull complete 716f7a5f3082: Pull complete 7b10f03a0309: Pull complete Digest: sha256:f6a001272d5d324c4c9f3f183e1b69e9e0ff12debeb7a092730d638c33e0de3e Status: Downloaded newer image for nginx:latest dfe13c68b3b86f01951af617df02be4897184cbf7a8b4d5caf1c3c5bd3fc267f 访问http://localhost/以显示nginx起始页。
Use the docker ps command to view the container list
Use the docker images command to view the mirror list
Accelerator
In Select Settings from the right-click menu of the tray icon in the lower right corner of the system. After opening the configuration window, select Docker Daemon from the left navigation menu. Edit the JSON string in the window and fill in the accelerator address such as Alibaba Cloud, DaoCloud, etc., such as:
{ "registry-mirrors": [ "https://sr5arhkn.mirror.aliyuncs.com", "http://14d216f4.m.daocloud.io" ], "insecure-registries": [] }
The above is the detailed content of Code example sharing on how to install Docker on Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Causes and solutions for errors when using PECL to install extensions in Docker environment When using Docker environment, we often encounter some headaches...

Why can't my code get the data returned by the API? In programming, we often encounter the problem of returning null values when API calls, which is not only confusing...

Mastering Debian system log monitoring is the key to efficient operation and maintenance. It can help you understand the system's operating conditions in a timely manner, quickly locate faults, and optimize system performance. This article will introduce several commonly used monitoring methods and tools. Monitoring system resources with the sysstat toolkit The sysstat toolkit provides a series of powerful command line tools for collecting, analyzing and reporting various system resource metrics, including CPU load, memory usage, disk I/O, network throughput, etc. The main tools include: sar: a comprehensive system resource statistics tool, covering CPU, memory, disk, network, etc. iostat: disk and CPU statistics. mpstat: Statistics of multi-core CPUs. pidsta

Multithreading in the language can greatly improve program efficiency. There are four main ways to implement multithreading in C language: Create independent processes: Create multiple independently running processes, each process has its own memory space. Pseudo-multithreading: Create multiple execution streams in a process that share the same memory space and execute alternately. Multi-threaded library: Use multi-threaded libraries such as pthreads to create and manage threads, providing rich thread operation functions. Coroutine: A lightweight multi-threaded implementation that divides tasks into small subtasks and executes them in turn.

Efficient reading of Windows system logs: Reversely traverse Evtx files When using Python to process Windows system log files (.evtx), direct reading will be from the earliest...

Python binary library (.whl) download method explores the difficulties many Python developers encounter when installing certain libraries on Windows systems. A common solution...

Choice of Python Cross-platform desktop application development library Many Python developers want to develop desktop applications that can run on both Windows and Linux systems...

Problems and solutions encountered when using the requests library to crawl web page data. When using the requests library to obtain web page data, you sometimes encounter the...
