Is IntelliJ's support for Dockerized Python environments compatible with Python running on a Windows container? - docker

My Python project is very windows-centric, we want the benefits of containers but we can't give up Windows just yet.
I'd like to be able to use the Dockerized remote python interpreter feature that comes with IntelliJ. This works flawlessly with Python running on a standard Linux container, but appears to work not at all for Python running on a Windows container.
I've built a new image based on a standard Microsoft Server core image. I've installed Miniconda, bootstrapped a Python environment and verified that I can start an interactive Python session from the command prompt.
Whenever I try to set this up I get an error message: "Can't retrieve image ID from build stream". This occurs at the moment when IntelliJ would have normally detected the python interpreter and it's installed libraries.
I also tried giving the full path for the interpreter: c:\miniconda\envs\htp\python.exe
I've never seen any mention that this works in the documentation, but nor have I seen any mention that it does not work. I totally accept that Windows Containers are an oddity, so it's entirely possible that IntelliJ's remote-Python feature was never tested on Python running in Windows containers.
So, has anybody got this feature working with Python running on a Windows container yet? Is there any reason to believe that it does or does not work?

Regrettably, it is not supported yet. Please vote for the feature request https://youtrack.jetbrains.com/issue/PY-45222 in order to increase its priority.

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 get started development inside docker container in windows operating system

I am a developer who is using Ubuntu 20.04 LTS regularly for my development. I never install any packages like, node, PHP, python in the OS and make use of docker for the purpose. VS Code is the editor I use, and the extension of the remote container will help me to develop & debug inside the docker container.
Right now, I am in the process of moving the development to a windows environment and I wanted to follow a similar workflow there too. Unfortunately, I am facing few issues like "file changes are not getting detected" (when npm serve in angular and react projects).
https://github.com/microsoft/WSL/issues/4739
https://www.reddit.com/r/bashonubuntuonwindows/comments/c48yej/wsl_2_react_not_reloading_with_file_changes/
I have tried different methods to solve the issue like
use wsl2 and then docker inside that and then serve from the container
use just docker and serve the code from inside the container
Regardless of the methods, the file changes are not getting detected inside the docker.
Trust me I have gone through many bizarre words like inotify, increasing the watchers, etc... Nothing helped.
Is there a developer out there following a similar practice in a Windows environment? (docker + windows)
Any help is highly appreciated.
I suggest moving the files to the wsl2 file system and not the windows.
Wsl2 'sees' the windows file system from inside a mount image /mnt/c .
Move out of it, like at ~ (cd ~) and i think your files will be normally watched .

Is there any way to isolate an app without using container under cygwin windows

I am using cygwin under windows server 2008 to have linux capability (to some degree) and ssh and be able to run apps without using a gui.
On another server that is ubuntu 18.04 I use containers to some how isolate my apps so that when I run an app and it spawns child processes and probabley modifies file descriptors etc (and so now I can not keep track of which processes are running now) I can stop my app and all the mess that it has done, with just stopping the container.
Containers made starting and stopping an app a clean and simple way.
Is there any way to have such thing on windows (without using docker on windows)? by saying this I mean the file and process isolation and not network or other stuff.
Is it possible to only isolate processes so that i can get rid of them with a single command?
Is there any tool for that? particularly for cygwin under windows?
I don't know about other languages but if you're using Python, it has a feature called Virtual Environment and developer can create and run applications in isolated environments. you can learn more about it here.
I myself come to the conclusion that using services and creating a service in windows would be the only way to manage an app without using a container.

Base Docker image from existing Windows machine

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.

How do you run an .exe file on Docker?

I am currently trying to understand and learn Docker. I have an app, .exe file, and I would like to run it on either Linux or OSX by creating a Docker. I've searched online but I can't find anything allowing one to do that, and I don't know Docker well enough to try and improvise something. Is this possible? Would I have to use Boot2Docker? Could you please point me in the right direction? Thank you in advance any help is appreciated.
Docker allows you to isolate applications running on a host, it does not provide a different OS to run those applications on (with the exception of a the client products that include a Linux VM since Docker was originally a Linux only tool). If the application runs on Linux, it can typically run inside a container. If the application cannot run on Linux, then it will not run inside a Linux container.
An exe is a windows binary format. This binary format incompatible with Linux (unless you run it inside of an emulator or VM). I'm not aware of any easy way to accomplish your goal. If you want to run this binary, then skip Docker on Linux and install a Windows VM on your host.
As other answers have said, Docker doesn't emulate the entire Windows OS that you would need in order to run an executable 'exe' file. However, there's another tool that may do something similar to what you want: "Wine" app from WineHQ. An abbreviated summary from their site:
Wine is a compatibility layer capable of running Windows applications
on several operating systems, such as Linux and macOS.
Instead of simulating internal Windows logic like a virtual
machine or emulator, Wine translates Windows API calls
on-the-fly, eliminating the performance and memory penalties of
other methods and allowing you to cleanly integrate Windows
applications into your desktop.
(I don't work with nor for WineHQ, nor have I actually used it yet. I've only heard of it, and it seems like it might be a solution for running a Windows program inside of a light-weight container.)

Resources