Home > Technology peripherals > It Industry > How to Install Docker on Windows 10 Home

How to Install Docker on Windows 10 Home

Joseph Gordon-Levitt
Release: 2025-02-15 10:23:11
Original
806 people have browsed it

How to Install Docker on Windows 10 Home

Run Docker on Windows 10 Home Edition: Guide to Bypass Installation Limits

Docker for Windows Installer won't run on Windows 10 Home Edition, but that doesn't mean you can't run Linux containers on Windows. This article will walk you through how to set up a Docker environment on Windows 10 Home Edition without relying on Hyper-V technology.

Key points:

  • Docker for Windows Installer is not compatible with Windows 10 Home Edition.
  • Running Linux containers on Windows 10 Home Edition does not require Hyper-V.
  • Docker Machine, Docker Engine, Docker Client, and Docker Compose are required to build and run containers.
  • Docker can be installed using Git Bash and Windows Subsystem for Linux 2 (WSL2).
  • Chocolatey can be used to install Docker Client and Docker Compose separately.
  • Easier solution: Switch to Linux development environment.

Working principle:

Docker relies on the Linux kernel to run Linux containers. To implement this feature on Windows, you need to set up a Linux virtual machine running as a guest in Windows 10 Home Edition. Docker Machine can simplify this process. The Docker client will use SSH to communicate with Docker Engine, and the container actually runs in a virtual machine, not on a Windows host.

Initial settings:

  1. Install Git Bash for Windows: as the main terminal for running Docker commands.
  2. Install Chocolatey: Windows Package Manager simplifies subsequent software installation.
  3. Install VirtualBox and its extensions: Or use the Chocolatey command: C: choco install virtualbox
  4. (Optional) Setting WSL2: If you want to run Docker in a WSL2 environment.

Docker Engine Settings:

  1. Installation of Docker Machine: Follow the official instructions to install, or use the Chocolatey command: C: choco install docker-machine
  2. Install Docker Engine with Git Bash: Run the following command, Docker Machine will download the Linux image containing Docker Engine and run it as a virtual machine: $ docker-machine create --driver virtualbox default
  3. Configure port forwarding: Start Oracle VM VirtualBox, select default Virtual Machine, click 设置 > 网络 > 适配器1 > 端口转发 and add the required port.
  4. Configure shared folder: In VirtualBox, select default Virtual Machine, go to 设置 > 共享文件夹, and add the Windows path you need to mount. Make sure the Permanent option is set. (Solve the invalid setting error: increase the video memory in the display settings)
  5. Start Linux virtual machine: Run in Git Bash:$ docker-machine start vbox
  6. Set Docker environment variables: Run the following command in Git Bash:
    $ docker-machine env default
    $ eval $(docker-machine env default --shell linux)
    Copy after login

    To avoid doing this every time you start Git Bash, save the eval output to the .bashrc file. Note: The Linux path of DOCKER_CERT_PATH needs to be converted to Windows path format.

Docker tool settings:

Install Docker Client and Docker Compose using PowerShell with Administrator permissions:

C:\ choco install docker-cli
C:\ choco install docker-compose
Copy after login

Switch back to Git Bash and run the following command to verify that Docker is running normally:

$ docker-machine start default
$ docker-machine ls
$ eval $(docker-machine env default --shell linux)
$ docker info
$ docker run hello-world
Copy after login

Successfully running the above command means that Docker has been installed successfully.

Set Docker on WSL2:

In WSL2 Ubuntu terminal:

  1. Installing Docker Client and Docker Compose: Follow the official documentation to install, or use pip to install Docker Compose.
  2. Fix Docker mount issue: Add the following content to the /etc/wsl.conf file (create the file if it does not exist):
    <code>[automount]
    root = /
    options = "metadata"</code>
    Copy after login

    Restart the system to make the settings take effect.

  3. Connect to Docker Engine virtual machine: Add Docker environment variables in the .bashrc file and execute source ~/.bashrc.

Switch to Linux:

Setting up Docker on Windows 10 Home Edition is more complicated. An easier solution is to switch to a Linux development environment.

Summary:

This article describes how to install and run Docker on Windows 10 Home Edition. If you encounter problems, please check the steps carefully. For a smoother Docker development experience, it is recommended to switch to Linux.

(The FAQs part is the same as the original text, omitted here)

The above is the detailed content of How to Install Docker on Windows 10 Home. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template