Unable to install Docker on windows 10 - docker

I am trying to install docker on windows machine but it doesn't get install and stop its process in the middle of installation.I have checked for all prerequisite,and my machine fulfills all.
I have NP AV antivirus and it gives me warning like C:\PROGRAM FILES\Docker\RES...\bin\DOCKER_COMPOSE.EXE is a threat after aborting the installation

It can depend on your Windows version (type winver in a CMD)
With 1903, there are reports of freeze or BSOD, with docker/for-win/issue 3815.
The main issue regarding the installation is docker/for-win/issue 1172,
This assumes that you have Windows Pro at least, with Hyper-V activated (and possibly the antivirus off during installation).
This thread includes:
Adding the downloaded installer .exe file to the Controlled Folder Access allowed apps list fixed the problem for me.
Start | Settings | and click on Controlled Folder Access
T hen click on “Allow an app through Controlled folder access”
Click on the big + beside “Add an allowed app” and choose Recently Blocked Apps.
Then you can choose the "Docker for Windows Installer.exe".
Re-run the installer as admin and it works.

Related

Docker Desktop cannot switch to Windows Container

I have installed latest Docker Desktop. Currently unable to switch to Windows container. The option is blocked from task bar :
I am running Windows 10 Home 64-bit Build 19042.
You need windows 10 Pro or Enterprise to have access to Windows containers.
Source
The other answer will indeed switch your daemon mode to Windows, but you will not be able to pull any Windows container.
Update 2022:
The link above now mentions that it should work for
Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher.
Windows 10 64-bit: Home or Pro 21H1 (build 19043) or higher, or Enterprise or Education 20H2 (build 19042) or higher.
I had spent hours debugging this issue and have to purchase win 10 pro license as well but still faced the same issue, by default it takes linux containers, switching to windows shows waiting forever, anyway here is how I fixed:
Windows Pro
Close/Shutt down the client by right clicking on the tiny icon on taskbar, and wait for a minute or two to have it close itself.
3.Open command prompt with Administrative rights
Type in this command:
c:\Program Files\Docker\Docker\resources>dockerd.exe
Open another command prompt with Administrative rights
C:\Program Files\Docker\Docker>DockerCli.exe -SwitchDaemon
Type "C:\Program Files\Docker\Docker>docker version" command to make sure it has switched to windows containers, it should look like attached screenshot
as per the latest Docker Desktop version, your settings should look like this
Quit Docker Desktop, and open again, Hope it helps some.
This command will change from windows to linux and vice versa.
I could not switch it easily, even using Altaf's approach. Eventually I went to Services (services.msc) and disabled Docker Desktop Service and updated docker service (Docker Engine) to make sure it can automatically start (for example, make sure the daemon.json config file exists in the location as the service command specified).
Then I can verify the result by typing docker version (in non-Administrative command prompt).
https://kontext.tech/article/1216/how-to-change-docker-data-root-path-on-windows-10#h-switch-to-windows-containers

Error "LoadLibrary failed with error 126: The module could not be found" when launching Spyder IDE through VPN

Here's what happens:
Using a Macbook Pro, I use the Microsoft Remote Desktop Connection application to connect to my work computer, which is a Windows 10 machine
If I try to launch Spyder on my work computer, I get this error:
Load Library Error
However:
If I am at my work computer (i.e. physically at work instead of logging in remotely), I can launch Spyder successfully
If I leave Spyder open on my work computer, then go home and do a remote log-in to my work computer, I can use Spyder without issue. The problem/error described above arises only if I try to open Spyder through the remote connection.
This error only seems to affect Spyder and I can use all other programs without issue through a remote connection. As a workaround I've been using other IDEs and successfully running scripts, but I strongly prefer Spyder.
What I have tried so far (without success):
The 4 troubleshooting steps posted by Fazil M. to this Microsoft thread
Uninstalling/reinstalling Spyder using Conda
Restarting my work computer
System Information:
Work Computer OS: Windows 10, 64-bit
OS of computer through which I'm logging in to work computer: Mac OS X El Capitan 10.11.6
Spyder version: 4.1.1
Any thoughts as to what could be going on?
Update--More information and trials:
I checked out Issue #3736 on Spyder's GitHub. It says to download and add a file called opengl32sw.dll to the folder ~\Lib\site-packages\PyQt5\Qt\bin. But when I go to the PyQt5 folder, I do not see a subfolder for Qt. I tried placing it into the PyQt5 main folder, but that did not fix the problem.
I've heard this can be a graphics card issue too. On my machine I have two graphics cards: AMD RadeonT R5 430 and Intel(R) HD Graphics 630.
Darren's answer did not work for me. What did work was to:
First option: go into the device manager and disable the Intel HD Graphics card under "display adapters."
Second option:
run "Gpedit.msc"
navigate to Computer Configuration->Administrative
Templates->Windows Components->Remote Desktop Services->Remote
Desktop Session Host->Remote Session Environment
Disable "use WDDM graphics display driver for remote desktop
connections"
Restart the computer
See https://answers.microsoft.com/en-us/windows/forum/all/windows-10-1903-may-update-black-screen-with/23c8a740-0c79-4042-851e-9d98d0efb539
It took help from my organization's IT contractor, but I fixed the issue by doing the following:
Run a file called "gpedit.msc", which will open up a window for Local Group Policy Editor
In the tree menu on the left, navigate to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment, and open the Remote Session Environment folder (not the subfolder within it)
Make sure the following are set to "Enabled":
"Use hardware graphics adapters for all Remote Desktop Services"
"Prioritize H.265/AVC444 graphics mode for Remote Desktop Connections"
"Configure H.264/AVC hardware encoding for Remote Desktop Connections"
Then restart the computer.
Since I was unable to get pass LoadLibrary 126 error using the solutions provided online and on here, I stepped back and realized the obvious workaround. The errors occurs when you open the program while you're using a remote session, right? The obvious solution is to launch the program while a remote session is not in progress. To do this while you're remoting, you should create a batch script to launch the program but make sure to include to a time delay before that (I used 'timeout 10 /nobreak' to do so). Run the batch script and, before your program launchs, disconnect from RDP. After enough time passes for the program to launch, you can reconnect to RDP and your program will be up and ready

Docker desktop crash on start up in Windows 10

I installed docker desktop on Windows 10 through 'Docker Desktop Installer'.
After installation I logged off and logged in. It crashes on start up after some time stating the message as below
Docker.Core.Backend.BackendDestroyException:
One or more errors occurred.
at Docker.Core.Pipe.NamedPipeClient.<TrySendAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters)
at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean withNotifications)
at Docker.Actions.<>c__DisplayClass26_0.<StartAsync>b__0()
at Docker.ApiServices.TaskQueuing.TaskQueue.<>c__DisplayClass18_0.<.ctor>b__1()
System.AggregateException:
One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Docker.Backend.LifecycleClient.DockerStart()
at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings, String daemonOptions, Credential credential)
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings, String daemonOptions, Credential credential)
Docker.Core.HttpBadResponseException:
unable to fetch daemon.json: Get http://unix/engine/daemon.json: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
at Docker.Backend.HttpClientExtensions.<ParseResponseBodyAsJsonAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpClientExtensions.<GetJsonAsync>d__0`1.MoveNext()
I uninstalled, re-started my PC and installed by selecting 'Windows Container'. Then after the restart checked on running docker. It started successfully. But when I switch to Linux containers it again fails with the same error message above.
The main goal to fix this is:
Press windows "start" button
Enter by keyboard services + enter
Find two of them : "Hyper-V Virtual Machine Management" and "Hyper-V Host Computer Service"
(on each service)click mouse right-button, select "properties" and change in opened window "startup type" to "manual", then "ok" button.
Click again on each mouse right-button and select start
Press windows "start" button, enter "hyper-v", it will show you hyper manager, open it
In hyper-v manager select "connect to server", from pop-up select "local computer"
Run your desktop docker it is probably working now with no crashes and exceptions.
What helps is already given in the other answers, i just try to be more specific and try to avoid some traps by using Environment-Variables in the paths and append some details and reasoning for the core problem:
First of all, make sure the "Docker Desktop Service" is running, which should be the case once you logged out and in again directly after install or rebooted the system. To check the status of services do either click/press/touch the Start-Button/Windows-Key to initiate the integrated Desktop-Search and type:
services
or type
services.msc
in either the desktop-search as stated before, or open the Run-dialog by pressing and holding down the "Windows-Key" and the "R"-key right after it as well, then release the keys. In the "Run-Dialog" type
services.msc
Use the command-line-interface (CLI)-tool "DockerCli.exe" with the attribute/option "SwitchDaemon". For this you need to open a command-line, either PowerShell or CommandShell, you do this by either click/press/touch the Start-Button/Windows-Key to initiate the integrated Desktop-Search and type:
cmd
for the CommandShell, or for the PowerShell:
powershell
or you type "cmd.exe" or "powershell.exe" in either the Desktop-Search as stated before, or you
open the Run-dialog by pressing and holding down the "Windows-Key" and the "R-Key" right after it as well, then release the keys. In the "Run-Dialog" type "cmd.exe" or "powershell.exe".
To actually switch the Docker-Service operation-mode use the following:
If you are in the Command-Shell/cmd.exe type:
cmd -C "%ProgramFiles%\Docker\Docker\DockerCli.exe -SwitchDaemon"
Or if you are in PowerShell type:
& "Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon"
If all that is too complex for you and you want to try a "fire&forget"-approach - relying on the assumption that the Docker-Desktop-Service is indeed running, because you either logged out and back in after install or you already rebooted your system, you may use the Run-Dialog (to open via Win+R) and paste the following line:
powershell.exe & "$Env:ProgramFiles/Docker/Docker/DockerCli.exe -SwitchDaemon"
This will work because it explicitly executes the PowerShell (which is part of Windows 10 and Docker Desktop only runs on Windows 10) and passes to it the command DockerCli.exe -SwitchDaemon.The path is determined via the System-Environment-Variable ProgramFiles which will resolve to your System-Root and Program-Files directory (in most cases "C:\Program Files", but can also be on a manually set drive-letter, e.g. "B:" (which is often used on embedded systems to prevent automatic creation of swap-files), so on "B:\Program Files" in that case.
It relies on the standard install-path of Docker Desktop on Windows 10 systems, if you changed it you have to adjust the path accordingly. You will have no feedback. Just start "Docker Desktop" from your Start-Menu after you pasted and executed the command from the Run-Dialog.
The path in all examples is set in quotes ("") to guarantee that it can be executed. This would be a necessity as well if you for example want to prepare a Shortcut on the Desktop for first use after deployment, e.g. titled "Run this once (if Docker Desktop fails to start)". This way you can make it part of an image with Docker preinstalled.
Be aware that the main problem is that Docker uses WSL2 to provide its Linux-based containers (on Windows 10 Home exclusively) and that to run Windows-Containers Hyper-V needs to be enabled, sadly the latter contradicts with WSL2 on Windows 10 Desktop operating systems. You can enable Hyper-V afterwards, together with Virtual-Machine-Services and Windows-Containers via Windows 10 Features, but it is not guaranteed it will work toegther with WSL2.
Click on the Start button
Then type services
Search for Docker Desktop Services.
Click on that
On the top left click on stop service
Then click on start service.
now open windows powershell as administrator
type docker
this will show you the list of commands
after that type docker images
this will show you the following error
error during connect: This error may indicate that the docker daemon is not running.
After that run this command
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
and then run the following command
docker images
This will solve your problems
The solution for me was to enable virtualization for my CPU in my computer's BIOS. Docker relies on virtualization to make containers work. For me, when it was disabled, Docker Desktop kept crashing and restarting and unhelpfully giving me very little information.
Here's a helpful page with some details on how to enable virtualization:
https://bce.berkeley.edu/enabling-virtualization-in-your-pc-bios.html
The short instructions are:
Reboot your computer.
Press DEL or F2 or whatever it is for your computer to get into the BIOS.
Look for CPU settings, then find something called VT-x, AMD-V, SVM, or Vanderpool. Enable it.
Save settings and restart your computer.
You should be open Hyper-V section.Docker doesn't work without Hyper-V.
How to open Hyper-V section:
Right click on the Windows button and select 'Apps and Features'.
Select Programs and Features on the right under related settings.
Select Turn Windows Features on or off. Select Hyper-V and click OK.
The FIX IS SIMPLE...
If you are using Docker Desktop for Windows, go to the System Tray in the lower right corner of your Windows screen, right-click the docker whale icon, and in the Docker settings popup choose Switch to Windows containers...
You cannot use the Linux Containers unless you install and are running a Linux Container host VM like Moby VM running under HyperVisor and also install and run the Docker Daemons and all its dependencies.
I would just use Windows Containers. Otherwise, you are looking at a larger setup on your Windows computer.
Updating my Windows version seems to fix this problem. I had the same error, but after updating Windows, Docker is working like a charm.

Docker Desktop Installer does not start

My docker installation stopped working, so I decided to uninstall docker and reinstall it.
First, uninstalling it did not work, I would uninstall it via the windows uninstall feature and then the app would reappear when I restarted my laptop. I also ran this script in powershell with admin privileges.
Then I somehow finally got it to uninstall and went to open the same installer I had used to install it the first time. And it did not open (did not even ask me for permission to make changes) so I figured I would redownload the installer.
Redownloaded it and had the exact same thing happen, tried it a couple of more times and suddenly it asked me for permission to start. I gleefully clicked yes and waited for the installer to start.
However, nothing happened. I tried it a couple more times and suddenly it worked and my installer started. Unfortunately, it hung on "Installing CLI Plugins". I let it sit there for more than 30 minutes waiting for something to happen until I hit the red x and then "yes" when it prompted me if I wanted to stop the installation". That didn't close the window so I force closed it via task manager.
I have restarted my laptop a bunch of times and clicked on the installer many more and have not gotten back to the install screen. Any help would be great.
Get-WmiObject -Class Win32_OperatingSystem | % Caption
Microsoft Windows 10 Pro
Get-WmiObject -Class Win32_OperatingSystem | % Buildnumber
18363
I am facing the same issue on a recurrent basis. Typically after a mandatory upgrade on my corporate PC.
Symptoms
Docker Desktop does not start
Docker Desktop installation fails due to service startup timeout
The following error show up
In Event Viewer > Windows Logs > Application was reporting the following error:
Faulting application name: Docker Desktop Installer.exe, version: 2.3.0.45183, time stamp: 0xb540b7fd
Faulting module name: ntdll.dll, version: 10.0.18362.815, time stamp: 0xb29ecf52
Exception code: 0xc0000005
Fault offset: 0x00000000000a10e7
Faulting process id: 0x232c
Faulting application start time: 0x01d63b7ed4bb1ca7
Faulting application path: C:\Users\johndoe\Downloads\Docker Desktop Installer.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: f19d010f-a418-4248-8828-38d409718a78
Faulting package full name:
Faulting package-relative application ID:
Solutions
Reinstall
Reinstalling Docker Desktop worked (once)
Specifically 2.3.0.45519 worked and 2.3.0.45183 was systematically failing.
However this trick only worked until the next upgrade. Hence solution 2
Disable Power Service
Run services.msc
Disable Power service (you will not be able to stop it)
Restart
Give it another shot.
I confirm after multiple reboots that this solution is repeatable.
Open command prompt as Run as Administrator
navigate to the downloaded folder cd C:\Users\ username\Downloads
Run the executable by just typing "Docker Desktop Installer.exe"
For me, the problem of not starting is because of Corporate Windows setup
This steps may help:
1.On you windows machine, enable Hyper-V and Containers check boxes.( Search on internet for enabling them)
2. Download docker for windows and start installing as admin
3. Once installation is done, open command prompt or power shell and run, 'docker version' and verify OS/Arch: and verify whether it shows Linux or Windows. If it shows Linux, switch to windows( Search on internet for switching).
Executed in cmd window and saw the report of an uncaught exception. It is using nlog for reporting install issues, so I reconfigured the nlog.config file in the folder where I am executing installer, with these lines in targets tag:
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!-- Write events to a file with the date in the filename. -->
<target xsi:type="File" name="f" FileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
<target xsi:type="File" name="file" FileName="${basedir}/logs/${shortdate}.log"/>
</targets>
and the installer run appropriately. Could be and old nlog.config in the folder.
I had the same problem. When I executed the installer through "cmd", with admin privs, it showed me the following error:
System.Exception: Path contains symlink: C:\ProgramData\DockerDesktop\
Turns out that I was actually using a Symbolic Link. I had made it before in order to save some disk space at C:.
Deleting it solved my problem. Although I'm running out of disk space.
I've just tried the installer for about the 45th time and it finally worked. Only things that have changed are that I've restarted the computer a couple times and its been a couple days since I last tried

Docker for window giving message-Time out has expired and the operation has not been completed

I have been trying to setup Docker for window machine and to run Asp.Net core 2.0 application in the Docker. I have setup below items.
Widow 10.
Visual Studio 2017, Community version.
Installed Core 2.0.
I have created a sample Asp.Net Core2.0 application and chosen Docker to run this application.
Below are the details -
Default project setup reference image-
Asp.Net core2.0 project setup
Docker run status
Below is the details for the timeout issue.
Time out has expired and the operation has not been completed.
at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout)
at Docker.Backend.Processes.WindowsDockerDaemon.TryToStartService(String args, Dictionary`2 env) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\Processes\WindowsDockerDaemon.cs:line 138
at Docker.Backend.ContainerEngine.Windows.DoStart(Settings settings, String daemonOptions) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Windows.cs:line 200
at Docker.Backend.ContainerEngine.Windows.Start(Settings settings, String daemonOptions) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Windows.cs:line 78
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.<Register>b__0(Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 47
at Docker.Core.Pipe.Nam
Can anyone suggest what could be issue for the timeout, I have tried and reset the docker
I think maybe we have same problem
After many month, I found my problem
As you can see in Crash while switching from Linux to Windows containers , My problem is one bug from Docker Desktop, that panic.txt is readonly after I change this from forums docker guideline
The short answer is
Go to C:\ProgramData\Docker (Or any other location that data-root locate to it)
Right click on panic.txt → Properties
Uncheck ‘Read-Only’
My problem is resolved (very very thanks to Tomas Slaman)
We had the same issue. We had to uninstall docker for Windows, and re-install. But this time we did not check the box (on the installation screen) which said "enable windows containers". So we just did next -> next which means Linux containers will be used instead of Windows, even though installation is being done on a Windows machine. Installation and launch were successful after that.
I came across this and thought it necessary to confirm if virtualization is enabled on my system, as it being disabled could be the problem. Apparently, that was my problem.
So basically, since I had Hyper-V turned on already under "Turn Windows Features on or off" I simply ran the script on windows power-shell in admin mode:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
This forced a restart, after which I was fine.
Here is a reference guide to enabling on windows-10:
https://thebackroomtech.com/2019/03/11/how-to-enable-virtualization-in-windows-10/
Hope this helps.

Resources