Setup Docker On Windows 10



Description I am using Docker version 1.12.5 on Windows 10 via Hyper-V and want to use container executables as commands in the current path. I built a Docker image that is running fine, but I hav. This version of Docker for Windows uses WSL2 as its engine allowing you to share your docker context across Windows and Linux on the same machine! As the maker intended! WSL 2 introduces a significant architectural change as it is a full Linux kernel built by Microsoft, allowing Linux containers to run natively without emulation.

Why Docker?

Docker is an open platform that can be used to deploy applications in isolated, secure containers. Docker containers are lightweight, simple to configure and work consistently in diverse IT environments. Most Bitnami applications are available as Docker containers and offer all the usual Bitnami benefits: security, optimization, consistency and frequent updates.

Setup Docker On Windows 10 Versions

Install Docker Toolbox in Windows

For Windows 7 (and higher) users, Docker provides Docker Toolbox, an installer that includes everything needed to configure and launch a Docker environment. Docker Toolbox allows you to deploy development containers in legacy Windows systems that do not meet the requirements of the new Docker for Windows application.

Docker Toolbox contains the following tools:

  • Docker Machine
  • Docker Engine
  • Docker Compose
  • Kinematic
  • Docker Quickstart Terminal App
  • Oracle VirtualBox

Prerequisites

Your Windows system must meet the following minimum requirements:

  • 64-bit Windows 7 (or higher)
  • Virtualization enabled

Step 1: Check system configuration

The first step is to check if your system configuration meets the requirements needed for running the installer successfully.

Check Windows version

Docker Toolbox requires 64-bit Windows 7 (or higher). There are many ways to verify if your machine meets these requirements.

Check OS version in Windows 10
  • Type “Settings” in the Windows Search Box and select “System -> About”.
  • Find your Edition and Version under your PC name.
  • Look “System type” to check if you are running a 32-bit or 64-bit version of Windows.
Check OS version in Windows 7 and 8
  • Go to “Control Panel -> System and Security -> System”. Check the Windows Edition and System Type.

Find more information about how to check your Windows operating system.

Enable hardware-assisted virtualization

Enabling hardware-assisted virtualization is mandatory for installing Docker Toolbox.

Hardware-assisted virtualization in Windows 8 or higher

You can check if your system supports this technology in two different ways.

  • Using the Windows Task Manager:

    • Type “Task Manager” in the Windows Search Box.
    • Click “Performance” tab. Look under “CPU” to find out if virtualization is enabled or not.
  • Using the Windows Command Prompt:

    • Type “Command Prompt” in the Windows Search Box.

    • Right-click to open the options menu. Select “Run as administrator”.

    • Navigate to the C: drive by typing:

    • Run the following command:

NOTE: If virtualization is not enabled in your machine, please check how to enable it in your BIOS by following your manufacturer’s instructions.

Hardware-assisted virtualization in Windows 7
  • Download and run the Microsoft Hardware-Assisted Virtualization Detection Tool.

Step 2: Install Docker Toolbox

Download Docker Toolbox

Once the system requirements have been verified, download the installer from the Docker website. Click the download button with the Windows logo.

NOTE: Make sure that you are installing the latest release of Docker Toolbox. Find the list of releases in Docker’s GitHub repository.

Docker Toolbox will install the following applications:

  • Docker Client for Windows
  • Docker Toolbox management tool and ISO
  • Oracle VirtualBox
  • Git MSYS-git UNIX tools

Launch the Docker Toolbox setup wizard

IMPORTANT: If you have VirtualBox installed and running, please shut down it before the installation begins.

These are the steps you must follow for completing the Docker Toolbox installation:

  • Open the installer by double-clicking the .exe file. Choose “Yes” in the Windows security dialog box to allow the program to make changes to your PC.

  • When the Docker Toolbox setup wizard starts, click the “Next” button.

  • Choose the local folder for Docker Toolbox installation. Click the “Next” button.

  • Check the components to be installed (“Git for Windows” is recommended; uncheck “VirtualBox” if already installed). Click “Next”.

  • Accept all default options and click the “Next” button.

  • Verify that all selected components will be installed. Click “Back” to change any settings.

  • Click the “Install” button to finish the installation. If Windows should ask you about permitting changes to your PC, click “Yes” to allow it to make the necessary changes.

  • After all the components are installed, the wizard will notify that installation was successful. Uncheck “View Shortcuts in File Explorer” and click “Finish”.

Step 3: Verify the installation

To verify installation, follow these steps:

  • Go to your desktop, which should have these three icons:

    • Docker Quickstart Terminal
    • Kitematic
    • Oracle VM VirtualBox.
  • Launch the Docker Quickstart Terminal by clicking the corresponding icon. This starts the creation of the Docker machine and all its components.

  • Click near the $ symbol to activate the terminal.

  • Type the following command and press Enter:

  • Docker will download and run the “Hello world” container. A confirmation message will be displayed in the terminal.

This indicates that your Docker installation is successful.

Step 4: Run Bitnami WordPress in Docker

Now that Docker is running, the next step is to use it with a Bitnami application. This guide will use the Bitnami WordPress Docker image.

The Bitnami WordPress Docker image provides the latest version of WordPress, including recent updates.This image deploys two containers, one for the database and another for the application itself.

Follow the steps below to deploy the Bitnami WordPress image:

  • Open the Docker Quickstart Terminal by double-clicking the icon.

  • Browse to Bitnami’s Docker image for WordPress. Click the “Clone or download” button. Copy the URL to the clipboard.

  • Type git clone in the Docker Quickstart Terminal and paste the URL:

  • Check the IP address of your Docker machine by executing the following command:

  • Change the directory:

  • Run the docker-compose up command to launch the containers and to create the volumes:

  • Access the application by browsing to the Docker machine IP address. You should see something like this:

Useful links

One of Docker’s goals has always been to provide the best experience working with containers from a Desktop environment, with an experience as close to native as possible whether you are working on Windows, Mac or Linux. We spend a lot of time working with the software stacks provided by Microsoft and Apple to achieve this. As part of this work, we have been closely monitoring Windows Subsystem for Linux (WSL) since it was introduced in 2016, to see how we could leverage it for our products.

The original WSL was an impressive effort to emulate a Linux Kernel on top of Windows, but there are such foundational differences between Windows and Linux that some things were impossible to implement with the same behavior as on native Linux, and this meant that it was impossible to run the Docker Engine and Kubernetes directly inside WSL. Instead, Docker Desktop developed an alternative solution using Hyper-V VMs and LinuxKit to achieve the seamless integration our users expect and love today.

Microsoft has just announced WSL 2 with a major architecture change: instead of using emulation, they are actually providing a real Linux Kernel running inside a lightweight VM. This approach is architecturally very close to what we do with LinuxKit and Hyper-V today, with the additional benefit that it is more lightweight and more tightly integrated with Windows than Docker can provide alone. The Docker daemon runs well on it with great performance, and the time it takes from a cold boot to have dockerd running in WSL 2 is around 2 seconds on our developer machines. We are very excited about this technology, and we are happy to announce that we are working on a new version of Docker Desktop leveraging WSL 2, with a public preview in July. It will make the Docker experience for developing with containers even greater, unlock new capabilities, and because WSL 2 works on Windows 10 Home edition, so will Docker Desktop.

As part of our shared effort to make Docker Desktop the best way to use Docker on Windows, Microsoft gave us early builds of WSL 2 so that we could evaluate the technology, see how it fits with our product, and share feedback about what is missing or broken. We started prototyping different approaches and we are now ready to share a little bit about what is coming in the next few months.

Install Docker On Windows 10 Virtual Machine

We will replace the Hyper-V VM we currently use by a WSL 2 integration package. This package will provide the same features as the current Docker Desktop VM: Kubernetes 1-click setup, automatic updates, transparent HTTP proxy configuration, access to the daemon from Windows, transparent bind mounts of Windows files, and more.

This integration package will contain both the server side components required to run Docker and Kubernetes, as well as the CLI tools used to interact with those components within WSL. We will then be able to introduce a new feature with Docker Desktop: Linux workspaces.

Linux Workspaces

Install docker on windows 10 without hyper-v

When using Docker Desktop today, the VM running the daemon is completely opaque: you can interact with the Docker and Kubernetes API from Windows, but you can’t run anything within the VM except Docker containers or Kubernetes Pods.

With WSL 2 integration, you will still experience the same seamless integration with Windows, but Linux programs running inside WSL will also be able to do the same. This has a huge impact for developers working on projects targeting a Linux environment, or with a build process tailored for Linux. No need for maintaining both Linux and Windows build scripts anymore! As an example, a developer at Docker can now work on the Linux Docker daemon on Windows, using the same set of tools and scripts as a developer on a Linux machine:

A developer working on the Docker Daemon using Docker Desktop technical preview, WSL 2 and VS Code remote

Also, bind mounts from WSL will support inotify events and have nearly identical I/O performance as on a native Linux machine, which will solve one of the major Docker Desktop pain points with I/O-heavy toolchains. NodeJS, PHP and other web development tools will benefit greatly from this feature.

Combined with Visual Studio Code “Remote to WSL”, Docker Desktop Linux workspaces will make it possible to run a full Linux toolchain for building containers on your local machine, from your IDE running on Windows.

Performance

With WSL 2, Microsoft put a huge amount of effort into performance and resource allocations: The VM is setup to use dynamic memory allocation, and can schedule work on all the Host CPUs, while consuming as little (or as much) memory it requires – within the limits of what the host can provide, and in a collaborative manner towards win32 processes running on the host.

Docker Desktop will leverage this to greatly improve its resource consumption. It will use as little or as much CPU and memory as it needs, and CPU/Memory intensive tasks such as building a container will run much faster than today.

In addition, the time to start a WSL 2 distribution and the Docker daemon after a cold start is blazingly fast – within 2s on our development laptops, compared to tens of seconds in the current version of Docker Desktop. This opens the door to battery-life optimizations by deferring the daemon startup to the first API call, and automatically stop the daemon when it is not running any container.

Zero-configuration bind mount support

One of the major issues users have today with Docker Desktop – especially in an enterprise environment – is the reliability of Windows file bind mounts. The current implementation relies on Samba Windows service, which may be deactivated, blocked by enterprise GPOs, blocked by 3rd party firewalls etc. Docker Desktop with WSL 2 will solve this whole category of issues by leveraging WSL features for implementing bind mounts of Windows files. It will provide an “it just works” experience, out of the box.

Thanks to our collaboration with Microsoft, we are already hard at work on implementing our vision. We have written core functionalities to deploy an integration package, run the daemon and expose it to Windows processes, with support for bind mounts and port forwarding.

A technical preview of Docker Desktop for WSL 2 will be available for download in July. It will run side by side with the current version of Docker Desktop, so you can continue to work safely on your existing projects. If you are running the latest Windows Insider build, you will be able to experience this first hand. In the coming months, we will add more features until the WSL 2 architecture is used in Docker Desktop for everyone running a compatible version of Windows.