Regarding Docker cross platform compatibility - docker

I want to ask about cross platform compatibilty of Docker ,means if an application is designed to run in a docker container on windows,then can it run on linux or vice -versa?

Docker was create to run on Linux, so the short answer is yes.
The Windows version isn’t stable or recommend (Docker for windows). At least not by now.
“But, Fischer, I use Docker on Windows!” Yes, with WSL (windows subsystem for linux - Some kind of VM), which you can configure to set a memory limit, using the .wsconfig file, and if you look at your Windows Menu you may found a Ubuntu icon, that connects you to the bash.
Docker is largely used for people that develop software, and today many languanges and frameworks use linux, even Microsoft with .Net runs on Linux.
Docker was created to resolve one simple issue: "But it works on my machine." So, it means that a container should run on every platform. At least "it works on my computer" lol

I think the question is regarding a Windows application. If that's the case, a Windows application cannot simply run on Linux containers. For example, .Net Framework doesn't run on Linux. If an application was targeted for Windows, it needs to run on Windows and in that case only a Windows container can run the application.
Docker Desktop can run both: Windows containers and Linux containers, just not at the same time. You have to switch the context so Docker Desktop can target either WSL (for Linux) or HCS (for Windows).

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.

How to run a portable executable in a docker on linux system

I am working on a application to deploy challenges for ctfs.
I want to include windows service type challenges, too.
How can I deploy a Portable Executable file on a linux based server?
You can not use docker to run Microsoft Windows. To run Windows executables on linux, you can try to use wine or rely on Virtualization (with a full windows installation inside).
You could also have a look at .net for linux to implement your challenge. This article should get you started if this is what you chose.

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.

Is it possible to run GUI apps in windows containers?

So I'm playing around with this containers concept and specificlly windows containers.
I managed to run containers using the windows nanoserver image, however this image meant to services and does not support gui applications (or 32 bit apps).
Couldn't find any mentioning of running gui applications (and see there gui) using windows container (found only linux container gui).
is there a way to run GUI apps in containers? and so how do I can create my own image containing this support?
As per my knowledge, its impossible because docker does not allow rdp inside container
The nano server is not supporting GUI. That's why I cannot see how this should work if your base image for your container is a nano server
No, it is not possible on Windows regardless of image. It is a system limitation. As a last hope to get this somehow running I would try to install a VNC server inside a container and would try to connect to it from outside. This approach works for Linux-based containers. But I'm doubting that it will work on Windows.

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