11/24/2021»»Wednesday

Install Docker Windows 10 Home

For Windows 10 Home 2004 users I no longer recommend this setup. Check out the following blog post instead:
https://golb.hplar.ch/2020/05/docker-windows-home-2004.html

  1. Cannot Install Docker Windows 10 Home
  2. Can You Install Docker On Windows 10 Home

I could be wrong, but it was my understanding that hyper-v functionality (virtualization required for docker to run on windows) was only available in win10 pro or enterprise. If that is incorrect, check your bios settings in case virtualization is disabled (intel setting often looks like VT-D, amd like Amd-V) then try again. With the introduction of WSL2 (Windows Subsystem for Linux 2), it is finally possible to install Docker natively on Windows Home edition. That’s enough background, let’s start installing docker 🕐 ️As a prerequisite, you need to be on Windows 10 version 2004. Dec 08, 2016 Install Docker on Windows 10. Docker is already builtin into Windows Server setups. On other Windows systems you will have to setup Docker yourself. There are two ways to install Docker on Windows depending on your Windows version. Docker Installer Method: Windows 10 64-bit Professional, Enterprise, and Education Versions include Hyper-V.

Install docker windows 10 home

In other words, rather then reutilising the Hyper-V virtual machine created by WSL 2, Docker for Windows creates a brand new virtual machine. Unfortunately, not all Windows versions ship with Hyper-V. Hyper-V is unavailable on Windows 10 Home, but ships with the Windows 10 Pro and Enterprise editions.

Docker Toolbox is the convenient option if you want to set up a Docker environment on Windows 10 Home.

However, I was curious if it is possible to set up Docker without installing anything (installing meaning running an installer). My goal was to download a few executables, copy them into an arbitrary folder, set some environment variables, and it should work.

Docker

In this tutorial, I'm going to copy all the files into c:docker. Change the commands accordingly with the folder you use.

  1. Install VirtualBox. The only component we have to install. Download the installer from the download page and run it. After the installation, reboot the computer.

  2. Download docker-machine. We need docker-machine for creating Docker hosts in VirtualBox. Check the release page and download the latest release

  3. Install tinycorelinux as Docker host in VirtualBox. Change the memory settings if you want to give Docker more or less memory.

    After the installation, check if the virtual machine is working.

    This command opens an SSH connection to tinycorelinux. Type exit to close the connection.

    To print the IP address of your Docker virtual machine run

  4. Download docker-client.

    Unzip the file into c:docker and delete dockerd.exe, the Docker daemon. You should end up with a folder that contains docker.exe and a bunch of dlls.

  5. Create a batch file start_docker.bat in the c:docker folder and insert the following commands.

    This batch file starts the docker host and sets environment variables so that we can run docker-client on Windows.

  6. Add c:docker to the system path.
    Open System Properties. From the command line, you can run this command: sysdm.cpl
    Open Advanced -> Environment Variables and add the directory to the Path variable.

    After a reboot, you can open a Command Prompt and start your Docker environment with start_docker

  7. Lastly, we set up shared folders. You can configure a shared folder via Command Prompt with the vboxmanage tool. In this example, I map the Windows folder c:dockerdata to the Docker host. Ensure that the folder exists before you run the command.

    You can achieve the same by entering the info manually in the VirtualBox GUI.

    Next, we need to create a folder inside the virtual machine and mount the shared folder.

    Add these two commands to the start_docker.bat script, because the mount is not persistent and you need to run the command each time you boot the virtual machine.

    To test the setup create index.html in c:dockerdata and start Nginx in a container. Make sure that you run start_docker.bat first.

    Check IP address of your docker host

    and open a browser with this IP address and port 8080. If everything works, you should see your HTML page.

Docker-Compose

Another tool you might need, especially if you start doing some more advanced things with Docker, is docker-compose. Check the download page for the latest release and download it.

Kubernetes

Minikube is an excellent tool if you start experimenting with Kubernetes. It installs a single-node Kubernetes cluster inside a VM.

Check the release page for the latest minikube version.

Check the documentation about kubectl for the latest version:

start installs a new virtual machine in VirtualBox. It does not reuse the existing tinycorelinux machine. It takes a while until all containers are set up.


This concludes our Docker installation from scratch.

Here’s a great article from SitePoint

If you’ve ever tried to install Docker for Windows, you’ve probably came to realize that the installer won’t run on Windows 10 Home. Only Windows Pro, Enterprise or Education support Docker. Upgrading your Windows license is pricey, and also pointless, since you can still run Linux Containers on Windows without relying on Hyper-V technology, a requirement for Docker for Windows.

If you plan on running Windows Containers, you’ll need a specific version and build of Windows Server. Check out the Windows container version compatibility matrix for details.

99.999% of the time, you only need a Linux Container, since it supports software built using open-source and .NET technologies. In addition, Linux Containers can run on any distro and on popular CPU architectures, including x86_64, ARM and IBM.

In this tutorial, I’ll show you how to quickly setup a Linux VM on Windows Home running Docker Engine with the help of Docker Machine. Here’s a list of software you’ll need to build and run Docker containers:

  • Docker Machine: a CLI tool for installing Docker Engine on virtual hosts
  • Docker Engine: runs on top of the Linux Kernel; used for building and running containers
  • Docker Client: a CLI tool for issuing commands to Docker Engine via REST API
  • Docker Compose: a tool for defining and running multi-container applications

I’ll show how to perform the installation in the following environments:

  1. On Windows using Git Bash
  2. On Windows Subsystem for Linux 2 (running Ubuntu 18.04)

First, allow me to explain how the Docker installation will work on Windows.

How it Works

As you probably know, Docker requires a Linux kernel to run Linux Containers. For this to work on Windows, you’ll need to set up a Linux virtual machine to run as guest in Windows 10 Home.

Setting up the Linux VM can be done manually. The easiest way is to use Docker Machine to do this work for you by running a single command. This Docker Linux VM can either run on your local system or on a remote server. Docker client will use SSH to communicate with Docker Engine. Whenever you create and run images, the actual process will happen within the VM, not on your host (Windows).

Let’s dive into the next section to set up the environment needed to install Docker.

Initial Setup

You may or may not have the following applications installed on your system. I’ll assume you don’t. If you do, make sure to upgrade to the latest versions. I’m also assuming you’re running the latest stable version of Windows. At the time of writing, I’m using Windows 10 Home version 1903. Let’s start installing the following:

Cannot Install Docker Windows 10 Home

  1. Install Git Bash for Windows. This will be our primary terminal for running Docker commands.

  2. Install Chocolatey, a package manager for Windows. It will make the work of installing the rest of the programs easier.

  3. Install VirtualBox and its extension. Alternatively, If you have finished installing Chocolatey, you can simply execute this command inside an elevated PowerShell terminal:

  4. If you’d like to try running Docker inside the WSL2 environment, you’ll need to set up WSL2 first. You can follow this tutorial for step-by-step instructions.

Docker Engine Setup

Installing Docker Engine is quite simple. First we need to install Docker Machine.

  1. Install Docker Machine by following instructions on this page. Alternatively, you can execute this command inside an elevated PowerShell terminal:

  2. Using Git Bash terminal, use Docker Machine to install Docker Engine. This will download a Linux image containing the Docker Engine and have it run as a VM using VirtualBox. Simply execute the following command:

  3. Next, we need to configure which ports are exposed when running Docker containers. Doing this will allow us to access our applications via localhost<:port>. Feel free to add as many as you want. To do this, you’ll need to launch Oracle VM VirtualBox from your start menu. Select default VM on the side menu. Next click on Settings > Network > Adapter 1 > Port Forwarding. You should find the ssh forwarding port already set up for you. You can add more like so:

  4. Next, we need to allow Docker to mount volumes located on your hard drive. By default, you can only mount from the C://Users/ directory. To add a different path, simply go to Oracle VM VirtualBox GUI. Select default VM and go to Settings > Shared Folders. Add a new one by clicking the plus symbol. Enter the fields like so. If there’s an option called Permanent, enable it.

  5. To get rid of the invalid settings error as seen in the above screenshot, simply increase Video Memory under the Display tab in the settings option. Video memory is not important in this case, as we’ll run the VM in headless mode.

  6. To start the Linux VM, simply execute this command in Git Bash. The Linux VM will launch. Give it some time for the boot process to complete. It shouldn’t take more than a minute. You’ll need to do this every time you boot your host OS:

  7. Next, we need to set up our Docker environment variables. This is to allow the Docker client and Docker Compose to communicate with the Docker Engine running in the Linux VM, default. You can do this by executing the commands in Git Bash:

    You’ll need to set the environment variables every time you start a new Git Bash terminal. If you’d like to avoid this, you can copy eval output and save it in your .bashrc file. It should look something like this:

    IMPORTANT: for the DOCKER_CERT_PATH, you’ll need to change the Linux file path to a Windows path format. Also take note that there’s a chance the IP address assigned might be different from the one you saved every time you start the default VM.

Can You Install Docker On Windows 10 Home

In the next section, we’ll install Docker Client and Docker Compose.

The post How to Install Docker on Windows 10 Home appeared first on SitePoint.

Most Viewed Posts