Build and run Windows container
Running Windows container... wait what? Windows??? WTF?
Okay, take it easy genius! It gonna be alright! Microsoft has been working closely with Docker to add containerized applications for its OS platform. And, it's working nicely even though at first you will feel the pain in the ass.
There are a couple of things you need to take into account working with Windows container
- First of all, you have to use a Windows machine to build and run Windows containers. Containers are using the underlying Operating System resources and drivers, so Windows containers can run on Windows only (Linux containers can run on Windows with WSL enabled).
- If you're using Docker Desktop on Windows 10, you have to use it with Windows Container enabled.
- There will be no GUI Windows environment (servercore or nanoserver) [1]. Of course, it's containers!
- There will be no "latest" tag for your Windows base docker image.
- Powershell is the King [2]. Just like any Linux container, you have to use a shell script (bash) to manipulate the OS your container is running in. In Windows, It's Powershell.
- Chocolately package manager is the Queen [3]. Similar to apt (Debian, Ubuntu), or rpm (Redhat based OS)
Container tools on Windows architecture [6] |
- Docker Desktop using Windows Container mode
- Windows 10
References
[1] https://searchwindowsserver.techtarget.com/tip/Clearing-up-the-Nano-Server-vs-Server-Core-confusion
[2] https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.1
[3] https://community.chocolatey.org/
[4] https://adamtheautomator.com/docker-windows-image/
[5] https://github.com/StefanScherer/dockerfiles-windows
[6] https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/containerd
Comments
Post a Comment