5

I'm using Docker Desktop for Windows with the new feature of Windows Containers now Windows-based containers are possible but it raised this question?

Can I mix linux-based and windows-based images in same docker engine host? If yes, are going to work all network features? Is this independent of the host OS for the user?

veben
  • 19,637
  • 14
  • 60
  • 80
  • It's still not possible to mix the two containers (Windows and Linux) but it is now possible to run Linux containers on W2016: [Linux Docker container on Windows Server 2016](http://stackoverflow.com/a/42978854/444244) – Boggin Mar 23 '17 at 15:55
  • I strongly advise against this, if you intend to communicate containers from different platforms. It literally took me a week to solve different weird errors with this, before finally giving up this design. – Nico Dec 01 '21 at 04:20

1 Answers1

0

No you can't. You will need a Linux to launch Linux containers and a Windows Server 2016 to launch Windows containers

I said in Run normal Win32 applications in Docker for Windows

if you have Windows Server 2016, you will be able to launch Windows containers (and you will need a Linux server to launch Linux containers).

See those links

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

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

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

In Windows, your Dockerfile will start with

FROM windowsservercore

instead of the more usual

FROM debian or FROM ubuntu

See some examples of IIS in (Windows) docker

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

or a SQL Server in docker

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

Community
  • 1
  • 1
user2915097
  • 30,758
  • 6
  • 57
  • 59