Roundabout Solution: Install Docker on Windows


highlight: gruvbox-dark theme: cyanosis

Hello, I'm shengjk1. I have many years of experience working at large tech companies, and I strive to build easy-to-understand, fun programming language tutorials. Welcome to follow me! You will get the following benefits:

  1. Learn from experience at large tech companies
  2. Acquire technical skills that meet the standards of large tech companies, and more

Let me know what content you'd like to see via comments or direct message!

1. Preface

Have you noticed recently that Windows is no longer popular, and neither are M1/M2/M3 Macs? Due to the rise of large AI models, the most sought-after setup right now is Ubuntu with an NVIDIA graphics card. Unfortunately, I have neither, so let me cry for a minute.

The graphics card issue is impossible for me to overcome, so I can only work around the system problem. I recently found some great projects on GitHub, but they are very unfriendly to Windows, so I had no choice but to use Docker.

2. Docker

2.1 What is Docker

The official website describes it this way: Docker helps developers build, share, run, and validate applications anywhere, without the hassle of tedious environment configuration and management. Docker is an independent process that contains all the files required for it to run. In essence, Docker is just a layer of encapsulation. It is no different in principle from creating an image of an operating system: it packages pre-configured applications for easy use on any system, abstracts away underlying details, and achieves the goal of "package once, run anywhere". This is essentially no different from how the JVM works.

2.2 How to use Docker on Windows

We will use Docker Desktop, let's walk through the installation below.

2.2.1 Docker Desktop

Docker Desktop is a one-click install application for Mac, Linux or Windows environments that allows you to build, share, and run containerized applications and microservices.

It provides a simple GUI (Graphical User Interface) that lets you manage containers, applications, and images directly from your computer.

Docker Desktop reduces the time spent on complex setups, so you can focus on writing code. It handles port mapping, file system issues and other default settings, and provides regular updates with bug fixes and security updates.

2.2.2 Download Docker Desktop

Docker Desktop download link

2.2.3 Enable Hyper-V

2.2.3.1 Enable Hyper-V on Windows 11 using PowerShell

Open PowerShell console as administrator, and run the following command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Important note: After enabling, programs that depend on specific hardware will not run properly. For example, games or applications that require GPU processing may not work correctly.

For instructions to enable Hyper-V on Windows 10, refer to this link

2.2.3.2 Verify that Hyper-V enabled successfully

Open Task Manager. If it shows that virtualization is enabled, the process was successful, as shown below:

2.2.4 Install Docker Desktop

Remember to enable Hyper-V first

2.2.5 Verify the installation was successful

Open Command Prompt or PowerShell

Run docker version

2.2.6 Verify that Docker Desktop is working correctly

Open Command Prompt or PowerShell

Run docker run hello-world

At this point, the installation is complete. You can start using Docker happily now. P.S. It's not happy at all for me — this is just a roundabout workaround, how could it be happy!

3. Summary

This article details the installation method of Docker on Windows, and is very friendly for beginners. Through this guide, readers can learn the basic concepts of Docker and the installation steps on Windows, laying a foundation for future Docker learning.


This discussion thread was separated from the original topic at https://juejin.cn/post/7368662916151033895