Base Docker image from existing Windows machine - docker

We have a large application with several parts running on a Windows VM and I am trying to evaluate Docker containers for our application deployment. Is it possible to create a base docker image from an existing Windows VM already running my application? (I know this can be done using Dockerfile but I am looking for a quick way to create the image)
https://docs.docker.com/engine/userguide/eng-image/baseimages/
Above link describes creating image from working machine for Linux, but I am looking for something similar for Windows.

The only base image for Windows that I know are the ones proposed by Microsoft, for Windows Server 2016 or 1709.
See "PoC: How to build images for 1709 without 1709"
That means you can translate any Widows VM into an image.
You would need:
a Dockerfile
the right Microsoft base image, which would represent a Windows server one.
Typically:
microsoft/nanoserver,
microsoft/windowsservercore
If you application only runs on a Windows VM, you need to make sure it can be installed and run on one of those base Windows images.
EVen though you are using a VM Windows server 2016, you would not be able to quickly "capture its state": you need a Dockerfile to describe what you want your Widows container to run.

No it's not possible. You have some stuff like Vm2Docker etc but all it does the same thing you will do manually that is enumerate features installed and create some artifacts for you.
But it's not possible to do for third party application as you mentioned. You'd have to disassemble it and figure out how to scripts to install it.

I am looking for a way to have a Development environment of Production web server for our Developers/testers created using Docker on windows.
I have windows server 2016 OS installed on a Physical server (not VM), and want to dockerize it so that Dev team can make changes on it first and once they confirm all working fine then same changes will be done on production web server.
Thanks,
RK.

Related

Can we debug .NET desktop apps in Docker container

(The more I dig this, the more confusing it gets. I have found Windows images available to download, but none of them appears to be the standard desktop OS)
Is there a way to debug my .NET Framework or .NET Core/5/6 desktop application (WinForms, WPF, VSTO) in a Docker container running Windows 10? I'm just trying to setup a playground environment that I could put together quickly and test my code.
For my own notes and any future beginner, here is my current finding:
Docker is not a full-fledged virtual machine like what we get with VirtualBox, VMWare etc. It's more like a process in an isolated environment, called a Container. For example you could create a container that runs an instance of MySQL, or a container that runs an instance of NodeJS. Of course there are images containing Operating System too, such as Ubuntu, Alpine or even Windows, but those images do not contain the full desktop environment; they are just the base OS services.
So answering the question, no, this is not (currently?) possible at least for Windows. People have had success running Ubuntu desktop inside a Docker container, but that is an advanced topic and only works in Linux-based containers. I haven't seen anything like that for Windows.

Does docker have a windows container to build windows applications on?

I am on a mac but want to build my application on a windows image. Is this possible with docker? If so what image do I need to use?
The reason I need to build the application on windows is for the code signing and binary building of electron. If this is not possible please let me know.
Since docker is not meant to be a UI for users (though it can be); images for Windows 7, 8, 10, et al are not available. However, Windows Server Core IS available via the Docker Hub.
If you simply need a x86 Win environment to build the application that should do the trick. If you need a full GUI, go Virtual Box or other virtualization tech. Docker containers are meant for single process isolation, ever see windows run only 1 process?
Hope this helps!
Update: It IS possible to run GUI applications via Docker; at least on a Linux host. http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/
Update2: It is now possible to run Windows applications (CLI or GUI) via Docker: here and here has information regarding the process.

what programs can be installed in a docker container

I am a Windows user.
I have looked at the official Docker tutorial "Get Started". The example focus is a python app. I don't know python and I guess a Docker container can have many programs installed as an environment, not just python.
Is Docker good for testing a program I download from the internet in an isolated environment (like a sandbox in firewalls or antivirus) ?
How for example can I make a container that has an environment containing installed programs like Visual Studio, VLC player, Office, etc.?
Thanks,
Abe
Yes; you can have an isolated environment with docker. You can set your desired configurations, download from internet, install, and whatever you do in a Virtual Machine.
Yes, you can. What your container contains depends on the base image you create it FROM and packages you install inside of it.
Tips
You can build your container from an empty OS (e.g. ubuntu), configure the OS, download/install/configure/run whatever you want.
You can create a base image which derives FROM a suitable OS, then install any basic application (e.g. firefox) which you may use in a lot of containers on it. Then you should push it in a registry (e.g. Github). After that, you can use it as a base image for other containers, so your new containers have installed applications by default; no need to install them again. It reduces complexity and repetitions in Dockerfile.

Access Windows 2016 Server Container (Docker container) via GUI?

I need to use Docker / Windows containers on Windows 2016 Server and prepare it Windows applications to run on it.
Configuring Windows via Powershell just is not as convenient though as it is on Ubuntu, especially if you never worked with Windows Server really and need to learn all the Powershell commands ;)
Is there a way to access a Windows Container via GUI?
It's possible with Docker, Ubuntu, VNC:
Can you run GUI apps in a docker container?
Wondering if anything similar can be done for Windows Containers?
(I am working on-premise, not using Azure. Found a similar but unanswered question here: https://stackoverflow.com/questions/32721422/windows-server-containers-azure-how-to-create-a-container-with-gui)
Thanks.
== Update ==
RDP is definitely not an option as per February 2016 - not sure if they plan to support it in the final release?!
https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/work_in_progress#remote-desktop
Remote Desktop
Windows Containers cannot be managed/interacted with through a RDP session in TP4.
So far I managed to have at least a decent file explorer by using Midnight Commander, but still command line on Windows is not much fun.
in this video MS-container-developer Taylor Brown says that they break up with RDP from TP3 to TP4 and will very probably do not support RDP in RTM Version Server 2016:
https://channel9.msdn.com/Events/TechNetVirtualConference/TechNetVC2016/Day-3-Containers-Session-with-QA
Update as of Dez. 2018:
Server 2019 is out and RDP is still not possible / supported for all container images. (of course it does not make any sense for nano images)
check this nice intro to what has changed: https://stefanscherer.github.io/docker-on-windows-server-2019/
to have a somewhat complete overview, it should be mentioned that there are some hacks out in the wild, that may RDP make work in some images and setups, e.g.:
https://withinrafael.com/2018/03/09/using-remote-desktop-services-in-containers/

Can I use Docker like this ...?

My work laptop is running LinuxMint as the base OS, plus Virtualbox to run Windows 7 which is the actual work environment, usually plus an additional Virtualbox VM to run a different Windows installation in which I do my client project work (I have one VM per client, to avoid messing up my main OS).
But I'm wondering if it's feasible and beneficent to switch to using Docker for the client project stuff? That is, I'd like to keep LinuxMint (to preserve my sanity), and keep Windows ('cause I have to use some MS products), but then instead of that series of "client VM's" use Docker containers?
I'm not entirely clear on how containers are useful. Can I, for instance, have a container in which I've installed dotNET and MS SQL; and then another container where I've installed an Azure Powershell; and a third container where I've installed Java and Eclipse -- and then decide which of these "sets" of software is available on the same common base OS (Windows, with VPN and Outlook and Notepad++)?
This post makes me think I'm asking for a solution from the wrong tool?
Or should I perhaps attack the root problem from a different angle, and ask the following over at Workplace.SE: How to work as a consultant without "cluttering up" one's (Windows) OS with more or less temporary installations of all sorts of software necessary for client projects?
AFAIK there is no WindowsOS ready to be run INSIDE a docker container localy, but they are anounced. See www.docker.com/microsoft and msdn windowscontainers
What you can do is run Linux OSs in docker containers within Windows. But in your case you should run the docker engine in your Mint Linux
Not really an answer, more like several comments -- though it's too long to fit within a comment
First of all I would not run Mint, but that's off the question.
Then, it may probably worth to take a look at How is Docker different from a normal virtual machine?.
Also, as you linked, Docker does not aim (at all) to run several programs. Indeed, their policy is Caas: Container as a Service. So basically one program per container. Saying all that, you can probably run wine within container and run one application on each container (over wine).
Have fun!

Resources