Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run linux docker image on windows

I've built a docker image on my mac and saved it to a tar(client's windows server doesn't have internet access to the outside world so I'll need to transfer this file to them).

From what I understand, on a Windows machine, I can install docker toolbox with VirtualBox, then I can start Docker QuickStartTerminal, which will start a docker machine which is essentially a linux VM.

Then, is it possible to run this docker image on a windows machine, is it specific to certain versions of windows?

Thank you for your time!

like image 947
M.PG Avatar asked Apr 15 '16 05:04

M.PG


2 Answers

It depends what you mean by running on Windows, if it is in Windows 7/8/10, or in Windows Server 2016

It is possible with Windows 7/8/10, as it is in fact a Linux VM

It is not possible with Windows Server 2016

You will need a Windows Server 2016 to launch a Windows container, and a Linux server to launch a Linux container.

I will update with a reference

Edit: If you have Windows Server 2016, you can launch an IIS docker container

https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/manage_docker

but you can't launch this IIS docker container from a Linux server running docker.

The same applies for a SQL docker container

https://26thcentury.com/2016/01/03/dockerfile-to-create-sql-server-express-windows-container-image/

When you create a Windows docker container, your Dockerfile starts with something like

FROM windowsservercore

while when you create a Linux container, your Dockerfile will start with

FROM debian:jessie

or

FROM busybox

or such

like image 115
user2915097 Avatar answered Sep 29 '22 06:09

user2915097


It is now possible to run Linux docker images on Windows 10 natively using Windows Subsystem for Linux 2 (WSL2).

Steps:

  • Install WSL2.
  • Install Docker for Windows.
  • Go to Docker Settings -> General and check mark "Use the WSL 2 based engine".

Source: https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers

like image 43
CausingUnderflowsEverywhere Avatar answered Sep 29 '22 06:09

CausingUnderflowsEverywhere