Windows 10 Pro Docker

  1. If you have a newer system, specifically 64bit Windows 10 Pro, with Enterprise and Education (1607 Anniversary update, Build 14393 or later), consider using Docker for Windows instead. It runs natively on the Windows, so there is no need for a pre-configured Docker QuickStart shell.
  2. Install Docker On Windows 10 Pro Plus. For more information about using.NET in a Docker container, see Introduction to.NET and Docker and Samples. Unable To Install Docker Ce On Windows 10 Pro Next steps Install Docker On Windows 10 Pro. How to check if.NET is already installed. Tutorial: Hello World tutorial.

Expected installation time: 3 hours.

Docker for Windows runs on 64-bit Windows 10 Pro, Enterprise, and Education; 1511 November update, Build 10586 or later. Docker plans to support more versions of Windows 10 in the future. We'll install it as a prerequisite for Docker Desktop for Windows. If you're running Windows Home, WSL 2 is the only way to run Docker Desktop. On Windows Pro, you can also use Hyper-V, but that is deprecated now, so WSL 2 is the way to go in all cases. We'll start by installing WSL 1 by enabling the WSL feature.

This guide covers building new projects based on Shopsys Framework.If you want to contribute to the framework itself,you need to install the whole shopsys/shopsys monorepo.Take a look at the article about Monorepo for more information.

This solution uses docker-sync (for relatively fast two-way synchronization of the application files between the host machine and Docker volume).

Warning

Docker-sync might be a burden for intensive project development, especially when there is a huge amount of files in shared volumes of virtualized docker and when switching between branches or even between projects often. In such a case, you should consider using native installation.

Supported systems¶

  • Windows 10 Pro
  • Windows 10 Enterprise
  • Windows 10 Education

Requirements¶

  • PHP
    • At least version 7.2 or higher
  • Docker for Windows
    • Docker for Windows requires at least 4 GB of memory, otherwise, composer install can result in Killed status (we recommend to set 2 GB RAM, 1 CPU and 2 GB Swap in Docker -> Preferences… -> Advanced)
    • Version of Docker Engine should be at least 17.05 or higher so it supports multi-stage builds.
    • Version of Docker Compose should be at least 1.17.0 or higher because we use compose file version 3.4
  • Docker-sync (installation guide see below)

Installation of Docker-sync for Windows¶

Warning

Be aware of using custom firewalls or protection tools other than default Windows Defender, we experienced that some of them make synchronization malfunctioning because of blocking synchronization ports.To speed up the synchronization and developing faster, you can exclude folder from indexing and search path of Windows Defender.

Prerequisites

In settings of Windows docker check Expose daemon on localhost:2375 in General tab and check drive option in Shared Drives tab, where the project will be installed, you will be prompted for your Windows credentials.

Enable WSL

Open the Windows Control Panel, Programs and Features, click on the left on Turn Windows features on or off and check Windows Subsystem for Linux near the bottom, restart of Windows is required.

Install Debian app

Install Debian app form Microsoft Store and launch it, so console window is opened.

Execute following commands in console window.

Update linux packages so system will be up to date to install packages needed for running docker-sync.

Now install the tools needed for adding package repositories from which the system will be able to download docker, docker-sync and unison synchronization strategy driver.

Add repository for docker, then install it and configure environment variable for connecting to Windows docker.

Install docker-compose tool that will help us to launch containers via docker-compose.yml configuration file.

Install ruby as installation tool for docker-sync in specific version for working unison synchronization strategy driver.

Download, compile and install OCaml.

Download, compile and install Unison.

Remove sources of sync tools

Set timezone of the system as docker-sync requirement.

Set WSL init script for mounting of computer drives from root path / instead of /mnt path.

Add valid Debian repository for php version that is used by composer and install composer.

Close console window and open it again so the new configuration is loaded.

Note

Sometimes something may not work correctly, so we highly recommend you do restart system and continue by guide

Shopsys Framework Installation¶

1. Create new project from Shopsys Framework sources¶

After WSL installation use linux console for each command.
Pick path of some directory in Windows filesystem and move into it, for example documents of windows user myuser so path will be like this.

Install project with composer.

Notes

  • The --no-install option disables installation of the vendors - this will be done later in the Docker container
  • The --keep-vcs option initializes GIT repository in your project folder that is needed for diff commands of the application build and keeps the GIT history of shopsys/project-base

2.1 Use install script¶

In case you want to start demo of the app as fast as possible, you can now execute install script.

If you want to know more about what is happening during installation, continue with next step.

2.2 Create docker-compose.yml and docker-sync.yml file¶

Create docker-compose.yml from template docker-compose-win.yml.dist.

Create docker-sync.yml from template docker-sync-win.yml.dist.

3. Compose Docker container¶

On Windows you need to synchronize folders using docker-sync.Before starting synchronization you need to create a directory for persisting Vendor data so you won't lose it when the container is shut down.

Then rebuild and start containers

Note

During installation there will be installed 3-rd party software as dependencies of Shopsys Framework by Dockerfile with licenses that are described in document Open Source License Acknowledgements and Third-Party Copyrights

5. Setup the application¶

If you're running macOS or Windows you have a few options for installing Docker. There's even a third way too, and we'll compare them here.

Unable To Install Docker Desktop On Windows 10 Pro

Are you using Windows 10 Pro or Enterprise? It specifically asks you for Windows 10 Pro or Enterprise.If you are using Windows 10 Home, the build version doesn't matter, you cannot use Docker Desktop. In Windows 10 home, docker desktop creates the VM under 'C: Users xxx AppData Local Docker' directory and it is this VM that contains the downloaded docker images. If you want to change the VM location from C: to a different directory you can do this by creating a junction on windows (prior to docker desktop installation) using a command like. Docker for Windows (Docker Desktop) As of May 27th 2020, Microsoft released Windows 10 build 2004 (Spring 2020) that allows you to run Docker Deskop on all editions of Windows 10, including Home thanks to WSL 2. As of August 2020, Microsoft enabled WSL 2 support for Windows 10 builds 1903 + 1909. On Windows 10 Pro, used latest VirtualBox 6, Ubuntu 18.04, extensions for windows, did all the step by step setup and waited an hour after starting the VM, nothing happened. Removed VDI Drive, Del. Docker Desktop for Windows は、Mirosoft Windows 用の Docker コミュニティ 版です。Docker Desktop for Windows は Docker Hub からダウンロードできます。 このページは、Docker Desktop を Windows 10 Pro、Enterprise、Education にインストールするための情報です。.

Quick Jump: OS and Hardware RequirementsPros and ConsWhich One Should I Use?

If you’re on macOS or Windows you can install Docker with:

  1. Docker for Mac / Windows (now known as Docker Desktop)
  2. Docker Toolbox
  3. Running your own Virtual Machine and installing Docker yourself

All 3 of those options have their own pros and cons and in this article we’re going to cover them. If you’re looking for a high level overview of what Docker for Mac / Windows and Docker Toolbox is, then check out this article on getting to know Docker’s ecosystem.

OS and Hardware Requirements

Pro

It’s helpful to know what you can install before we compare everything, so let’s do that:

Docker for Mac (Docker Desktop)

Install Docker Desktop On Windows 10 Professional

Docker for Mac requires that you’re running Mojave 10.14+ or newer with an Intel CPU. M1 support is on its way.

You can run VirtualBox 6+ alongside Docker Desktop. This is pretty useful because you might have some legacy apps running in Vagrant / VirtualBox to deal with (I know I do!).

Docker for Windows (Docker Desktop)

Windows 10 Pro Docker Commands

As of May 27th 2020, Microsoft released Windows 10 build 2004 (Spring 2020) that allows you to run Docker Deskop on all editions of Windows 10, including Home thanks to WSL 2.

As of August 2020, Microsoft enabled WSL 2 support for Windows 10 builds 1903 + 1909.

Install Docker Desktop On Windows 10 Pro 64

For years prior to that you could only run it on Windows Pro, Enterprise or any edition that had Hyper-V available, but since August 2020 pretty much all supported versions of Windows 10 can use Docker Desktop.

You can also run VirtualBox 6+ alongside Docker Desktop too in case you have older projects using VirtualBox (perhaps with Vagrant too).

Docker Toolbox

Prior to mid-2020 this was still a reasonable way to run Docker on machines that couldn’t run Docker Desktop, but that’s no longer the case.

Install Docker Desktop On Windows 10 Pro

It’s now considered legacy and as of late 2020 it’s been officially deprecated.

Unless you’re using unsupported versions of Windows or have a really really ancient Mac you shouldn’t need to ever use this tool.

But if you’re in a pinch and you absolutely must use it, technically it’s still available at https://github.com/docker/toolbox/releases, but it’s no longer maintained by Docker.

Your own Virtual Machine

Docker will happily run inside of VirtualBox, VMWare Workstation or any other Type 1 / 2 Hypervisor that’s running a major distribution of Linux as a guest OS.

If for whatever reason you can’t use Docker Desktop then this solution would be better than using Docker Toolbox since you can install supported versions of Docker and you have full control over the environment.

Pros and Cons

Now for the good stuff!

Docker for Mac / Docker for Windows (Docker Desktop)

Pros
  • Offers the most “native” experience, you can easily use any terminal you you want since Docker is effectively running on localhost from macOS / Windows’ POV.

  • Docker is heavily developing and polishing this solution.

Cons
  • On certain macOS hardware combos the volume performance can be a little slow.

  • I can legit say there are not any “wow this sucks!” cons for Windows, it’s really solid.

Docker Toolbox

Pro
Pros
  • Offers an “out of the box” Docker experience if you have no other choice.
Cons
  • It’s deprecated by Docker and will receive no future maintenance.

  • You need to either use the Docker Quickstart Terminal, or configure your own terminal to connect to the Docker Daemon running a VM.

  • Not a native solution, so you’ll need to access your Docker Machine’s IP address if you’re developing web apps. Example: 192.168.99.100 instead of localhost.

  • Unless you jump through hoops, your code needs to live in your Windows user directory such as C:UsersNicksrcmyapp. Otherwise Docker won’t be able to find it.

  • Suffers from typical VirtualBox edge case bugs and mount performance issues.

Your own Virtual Machine

I’m not going to bother listing a pros and cons here because I wouldn’t recommend doing this UNLESS you’re stuck on Windows 7 / 8 or an older version of Windows 10 like 1809.

Windows 10 Pro Docker

But more on that in a bit.

Which One Should I Use?

If you’re interested in Docker, you’re a smart person and you probably came to the conclusion that using Docker for Mac or Docker for Windows is a good idea as long as you can run it.

My recommendation would be to try Docker for Mac / Windows first, and test it against your actual use cases. The performance issues may or may not be a concern, especially since everyone’s needs and computer specs are different.

I’ve been using Docker Desktop on Windows for full time development since late 2018 and it’s been nothing short of fantastic. Currently I use it with WSL 2, but it was really good with WSL 1 along with Hyper-V too.

Stuck on an Old Version of Windows and Like Linux?

I want to mention a “roll your own VM” solution for Windows users because I feel like there’s an even better way to run Docker on Windows if you also like Linux and are stuck not being able to use modern versions of Windows 10.

It involves running VMWare Player in a special mode called “Unity mode”. This basically allows you to run Windows and Linux together seamlessly as 1 operating system.

There’s no dual booting and Linux applications (even graphical apps) run in their own floating windows. Then you can install Docker natively on Linux inside of the VM.

The performance is excellent and the entire set up is free too.

Windows 10 Pro Docker Image

I used this set up for about 5 years until Docker Desktop was available. It gives you the best of both worlds. For example, I run high end audio / video apps on Windows while recording courses and screencasts that cover Linux content. It all works great (even for full time development).

Windows 10 Pro Docker Windows 10

You can watch a video guide and see screenshots on how to do that in this post on creating an awesome Linux development environment in Windows.

Windows 10 Pro Docker Toolbox

Are you using the Docker Toolbox, Docker for Mac / Windows or your own VM?