Docker Service won't start Windows Server 2016 - docker

I followed the steps in this link to install Docker on Windows Server 2016.
OS Name Microsoft Windows Server 2016 Standard
Version 10.0.14393 Build 14393
Docker installs fine, but the service just stays in "Starting" when I restart the server. There are no Docker related messages in the event logs, so I have absolutely no idea what the problem is. I also tried deregistering the service, and registering it listening on the default named pipe and an IP address.

In my case the docker Service didn't start after fresh Installation cause I already had a Hyper-V Switch type NAT and a corresponding NETNAT object. Docker for Windows is trying to create a new NETNAT object for it's HNS internal Network, and can't do so, cause the other NETNAT object already exists.
I remove the Hyper-V Switch and the NETNAT object ( get-netnat | remove-netnat), and after that the Installation for Docker on Windows Server 2016 worked without any Problems - and the Docker Service was started automatically after reboot.

Related

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

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:

Microsoft Azure Devops Override Network driver when container job is initializing

I encountered an issue and not sure any of you encountered before. I tried to start a container job in which Linux based hosted on Window Server 2019. The hosted machine has docker EE installed and was able to run the container.
However, when I tried to trigger the Azure Pipeline to run the job in the the self-hosted machine, it shows following error:
Failed to create network
It appears that the agent failed to create the network using the default driver (Bridge) before starting up the container as the self-hosting server is Windows Server - windows uses NAT driver whereas the default driver for Docker is Bridge driver.
I wonder is it possible to override the driver using NAT driver in azure-pipeline? I tried using the following method but it seemed like not able to override it.
azure-pipelines
Or, is there any alternative way to disable the agent to create the network before starting the docker?
Or, is there any alternative to run Linux container in Windows Server?

Docker Windows master node "docker swarm init" causes worker nodes in same Virtual Network to no longer see the master node

I have strange behaviour related to docker swarm mode on windows. What I have done:
Deployed two "Windows Server 2019 Datacenter with Containers - Gen1" virtual machines in Azure
Setting RDP access from my IP to the virtual machines
Ensures they are in the same virtual network and their subnet is associated with the virtual network
Downloaded all windows updates
Used telnet to check if worker machine sees master by running "telnet 10.0.0.4 3389". This works.
Used telnet to check if master machine sees worker by running "telnet 10.0.0.5 3389". This works.
Ensured that Docker Swarm ports are open in Windows Firefall too for both machines: 4789, 7946 (UDP) and 2377, 7946 (TCP)
Initialized docker swarm mode on master node with the command: "docker swarm init --advertise-addr 10.0.0.4"
Checked that "docker node ls" lists the master as Ready
Immediately after this tried to use "telnet 10.0.0.4 3389" from worker node to see if master is still accessible - it no longer works!
Not surprisingly, trying to join the docker swarm from the worker also fails in the usual "timeout" error
Due to the fact that telnet 10.0.0.4 3389 worked before master node entered swarm mode, but not after, it seems docker windows is doing some changes to the firewall priorities or rules, or changing the active network or something... Which is bonkers. I have not found a solution to this problem, which is making docker-for-windows unusable. Note: This problem only occurs in Azure. Using virtual machines in Exoscale and manually installing docker with powershell scripts did not show the same issue, which makes me think perhaps the "Windows Server 2019 Datacenter with Containers - Gen1" servers have some faulty configurations.
Edit:
I can confirm that this behaviour does not appear when manually installing docker for 2019 data centers using the following guide: https://blog.sixeyed.com/getting-started-with-docker-on-windows-server-2019/ (sixeyed is a known Docker for Windows expert). In other words "Windows Server 2019 Datacenter" image works.
I can confirm that this behaviour does not appear when manually installing docker for 2019 data centers using the following guide: https://blog.sixeyed.com/getting-started-with-docker-on-windows-server-2019/ (sixeyed is a known Docker for Windows expert). In other words "Windows Server 2019 Datacenter" image works.
So, do not use the "Windows Server 2019 Datacenter with Containers - Gen1" image. Instead, use the standard image and follow standard docker-for-windows-server-2019 installation guides to get swarm mode working.

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

Azure Service Fabric On-Premise docker network default ip range

We are running windows containers on an on-premise Azure Service Fabric installation. We are building the fabric nodes from a corporate template (Windows 2016 with container support) that also contains an internal firewall product (also controlling the flows between internal networks in the node). The configuration of this firewall is centrally managed.
In order to correctly configure the firewalls, we need to control the IP range of the docker network. To do this we created or own docker network (of type 'nat') and named it 'xyz'. (as the current docker-ee for windows version does not accept the "fixed-cidr" parameter in the configuration file).
When using containers in service fabric we ran into problems because when the container is started by sf, it tries to attach to a default network named 'nat'. Apparently it is not possible to name a custom network 'nat', or to pass the name of a network to which the container should attach to service fabric (either through classic application package or docker compose file).
To solve the problems following would work:
Fix the IP segment address during Docker for Windows installation
Have the option to specify the name of the network the container should connect to when started by service fabric (when starting the container manually this can be done with the --network option)
????
Any suggestions?
Only thing you can do today is option 1.
We are working on 2 :-)

Resources