how to change Docker server host configuration from Linux to Windows? - docker

I am new to Docker and I am trying to setup and build docker image on my local Windows 10 machine. I created a simple .Net program and added Docker support to it. I also installed Docker Desktop on my machine. When I load my project with VS.Net 2019, I got the following error message: "A non-critical error occurred while getting containers ready. Your project will continue to function normally. The error was: Your Docker server host is configured for 'Linux', however the docker-compose project targets 'Windows'". My question is - how do I change my Docker server host configuration from Linux to Windows?

I'm assuming you have Docker Desktop deployed on your host - you can change between Windows and Linux containers by selecting the Docker icon from the icons tray, and click the option to switch:

Related

How to enable mixed platform on Docker on year 2022?

I checked out some tutorials but the Daemon tab is already missing with the current version of Docker Desktop(4.8.1). Under the "Docker Engine" tab, I set the 'experimental' field to 'true' but it looks like it is still not working.
The "platform" parameter isn't working.
What works:
Running linux based containers, Switch to Windows containers... and
run windows containers. Running containers will keep on running. You'll find it on right-click on system tray
of Docker Desktop.
Pull windows and linux based containers in Windows mode, but NOT in linux mode
Creating a compose file and use the keys platform: linux and platform: windows mixed, while running Windows container mode. Compose will choose the daemon for you.
You can not:
Build images on a daemon not supporting the OS of the image, see Roadmap
I don't know whats wrong in your case. In Windows Mode with
{
"experimental": true
}
(you have to set it again in Windows Mode, there are 2 different daemon settings)
you should be able to pull linux and windows images. Just checked with docker desktop 4.9.0 (prebuild), can't pull in 4.8.1 due to bug in proxy settings..

VSCode cannot access Docker image inside wsl2 image

I am running a cuda enabled docker container inside wsl2 and when i try to use VSCode to run scripts inside it i cannot connect to it. The message in the docker plugin window is:
Error: connect EACCESS /var/run/docker.sock
I added the default user in the wsl to the docker group. I double-checked and i know for sure that i can run docker as a user. How do I elevate the VSCode privillages to make it able to access the docker inside the wsl image?
Btw. I cannot use docker desktop because it does not allow to use the gpu inside the container.
UPDATE
So with the set of plugins locally:Docker, Remote - WSL, Remote - Containers, Remote SSH, Remote Development, Remote SSH - editing configuration files
in the WSL: Docker Explorer, Docker, Docker Extension Pack
I am able to log from VSCode directly to the console and perform other basic operations (starting containers etc). Attaching VSCode is still impossible as for now. At least the menu option under RMB throws an error

VSCode in-container-debugging over SSH machine

I am trying to setup and advanced configuration with VScode insider and I ma facing an issue.
My setup is:
VSCode Running in my local machine Windows 10 with a Django source code hosted on my machine. I have no docker client on this machine, and I don't wont to install one...
A virtual machine with Ubuntu is running a docker daemon, docker client and docker-compose. My workspace is shared over vboxfs and mounted on my Ubuntu
A python docker container is running in the Ubuntu machine and running the mounted code.
I tried to use the Remote Extension to debug the python code inside the container. However, when a run my vscode inside on the remote SSH Taget (so the ubuntu machine), I am able to manage docker objects (images, containers, etc...) using the Docker extension of vscode, but I can't see the option: Remote-Containers: Open Folder in Container. It's not found in the F1 command... I can see the other related command like: Remote-Containers: Settings.
Do you have any idea ? Or my setup is not supported by the extension ? It seems like it supports SSH development or Container development but not mixing both together, right ?
Is there any other VSCode config to debug in my targeted setup ?
Regards

Teamcity - Unmet requirements: docker.server.osType contains windows

I installed Docker Desktop 2.0.0.3 on my Teamcity (build 61245) Build Agent and restarted the Build Agent/Server, I've also switch to run Windows containers but I am still getting
Unmet requirements: docker.server.osType contains windows
Is this something I need to manually setup?
Docker plugin is installed and enabled by default in this build of Teamcity.
This might be a Teamcity bug where the docker.server.osType is not being set when running windows containers in Docker Desktop for Windows (Windows Server 2016).
My original setup, I had Docker running Windows containers in my Teamcity Server/Agent machine running Windows Server 2016. I was expecting to use Docker Wrapper and run Docker image platform set to Windows (I realized that would not work with the node image since that is built under the Linux platform). However, my docker.server.osType should still be set to windows regardless and I should have passed the compatibility check.
What I did to get around this was to run linux containers in my Windows Server 2016 machine. Below are the steps I took to address this issue.
In the build agent, Docker Settings -> Daemon -> Check Experimental Features
In the builder server {TeamCityDirectory}\conf\teamcity-startup.properties -> add teamcity.docker.lcow.enabled = true
Switch docker to run linux containers
After doing that, I restarted my Build Agent and Build Server services, and the docker.server.osType in my Build Agent popped up to with value of linux. I then set my build step's Docker image platform to linux.

Docker Windows Container with Service Fabric on Windows Server

I have a Service Fabric cluster installed on 5 virtual machines which are running Windows Server 2016. I would like to run docker windows container inside my Service Fabric cluster. I'm fairly new to the SF and Docker and I have couple of questions:
To make it work do I have to install Docker on each node? (If so which version CE or EE?) Because when I deploy my SF app with windows container service inside, it gives me an error during application start Error event: SourceId='System.Hosting', Property='Download:1.0:1.0:45cc185a-abde-47f4-9a1f-943ad6e29d23'.
There was an error during download.Container deployment is not supported on the node.
Can I run linux container on Service Fabric installed on Windows Server?
Yes you need to have the Containers feature enabled. Or, when running in Azure, you can use a host with the Containers feature already enabled, e.g. '2016-Datacenter-with-Containers'.
No, you can't do that inside a cluster at this time.
More info:
here
here

Resources