Windows-based development environment using Docker

danholt1337
Wed, 22 Jan 2025 20:51:56 +0000
General

Hi there,

I do not know if this is the correct (sub)forum for asking this, but here goes.

I installed Docker (Desktop) on Windows 11 and I’d like to use it to set up a reusable, portable, shareable development environment for the development of a Python-based Windows desktop application that we have in development. (We currently provide installation instructions for manually setting up a local dev environment on a Windows machine, but this is tedious, error prone and we would like to facilitate this and make it more uniform.)

So instead of going for some (full) virtual machine solution, I thought about using Docker. The environment should contain Anaconda, Git (+ Bash and Fork), Notepad++, PyCharm, Mingw-w64, Visual Studio Build Tools and CMake.

I used “dockur/windows” (https://github.com/dockur/windows) as the base image and got it up and running within a Docker container. However, if I stop the container from within Docker Desktop, the associated mounted volume is gone, the downloaded Windows 11 image file (5GB+) within that volume is (of course) gone as well, and restarting the container results in redownloading and reinstalling Windows 11 within the started container.

This is not what I want. I want to start the container, install/configure everything and then fully save the resulting state/image so it can be easily restarted later on without having to redownload/reconfigure everything and lose state/progress.

And this is where I’m at a loss. docker commit does not do what I want; it does not retain the current, full Windows installation/configuration within the newly committed image, probably since it does not add the downloaded Windows 11 image file within the mounted volume and/or any state within (or pertaining to) it.

The more I read about it, the more it seems that Docker is not the way to go here, since it does not seem to be able to (easily) do what I want. Is this true and should I go, e.g., for a full virtual-machine solution instead? Or is there some way to do this using Docker (I read that a Dockerfile might be an option, but I didn’t find how to leverage this to do what I want)?

Best regards and many thanks in advance,

Dan.

3 posts - 3 participants