Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run normal Win32 applications in Docker for Windows

I'm a little bit confused about the concept of Docker for Windows. Can I create a docker container for windows (and a windows host like Server 2016) and install a normal windows application into that container (simple: notepad.exe; advanced some more complex application programmed in Delphi)? And can I run this container on every Docker enabled (windows) Host? Does the container starts automatically the application inside? Or can a windows docker container only provide service or webbased applications like an IIS website?

like image 239
Konrad Avatar asked Feb 23 '16 08:02

Konrad


2 Answers

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/

like image 107
user2915097 Avatar answered Sep 21 '22 07:09

user2915097


The types of application that are candidates for docker are applications that do not have a UI.

Unlike a VM docker images are very slim having only enough codebase to service a particular use case. You can however create a docker image and use VNC to view a desktop like environment; but you have to go through hoops to configure it. Far easier to have a VM if you need a gui surface.

The strength of docker is to easily create containers of servers and DB back ends. You can even run email servers, or a stack of restful services.

On my laptop I had installed mysql, IIS and PHP. With docker I migrated all of these into an image. I spin it up when I need it and in less than 10 seconds i have a working db backend, an IIS server with PHP interface. I can maintain different versions of mysql, IIS and PHP for different iterations, they are all isolated from each other and run in their own container. When I upgrade my laptop I will not need to install any of these, just the image will work.

like image 22
Faizulla Khan Avatar answered Sep 23 '22 07:09

Faizulla Khan