Not able to start Docker after Windows shutdown - windows

I just installed docker on my Windows 10 Single Home Language. On the first start it works fine but when I shutdown my system and then restart it again then the docker does not start.
I tried using stop com.docker.service and then start com.docker.service and also tried deleting settings.json file. But the issue remains the same

Related

Docker container as Windows service start before login

I have created a container via Docker Desktop on a Windows PC and would now like to start this container like a service or daemon during system startup. If successful, the container would be accessible from its own network via 192.168.178.35:80 without a user having to log in and start Docker.
This is really not my favorite topic but I tried to learn about Windows task scheduling.
As you can see here I wrote a short powershell script that starts Docker Desktop.exe and then the container.
start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
sleep 10
docker start 9df2014cdb06
exit
I assigned the script to the SYSTEM user in the task scheduler. (see screenshot 1)
Unfortunately, 192.168.178.35:80 cannot be reached when the system is booted. When I log in, I see that various Docker background processes in Task manager. (See screenshot 2).
However, Docker is no longer accessible in Powershell. (See error message)
PS C:\WINDOWS\system32> docker ps
error during connect: In the default daemon configuration on Windows, the docker client must be
run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json":
open //./pipe/docker_engine: The system cannot find the file specified.
And starting it from the desktop icon does not succeed either. Instead, the message appears that Docker is already running.
But my container is not running.
How do I get my container running and accessible on Windows after system startup and before user login?

How to automatically start docker container on windows boot ~ Wait for docker to be running

I have a container that I pretty much need every time when starting my development PC, so I am trying to get it to autostart.
I have already written a .bat file that works fine for starting the container once docker is up, and have put that into the autostart folder on windows but...
...when starting my PC, that .bat executes before docker has started running, and thus terminates without starting the container. Once docker is up and running, I can use the .bat manually to start it just fine.
So here's my question: Is there anything I can add to my .bat to tell it to wait for docker to be running before trying to start the container?
Currently, the bat simply says docker-compose up and nothing else.
Add
restart: unless-stopped
or
restart: always
to the container in your docker-compose.yml, then use docker-compose up manually once more. This will make Docker to start the container after Docker itself is started.

docker desktop Preferences settings page is not loading and state is docker desktop is starting from forever

Main issue is docker desktop is not starting in mac &
The status bar is showing docker desktop is starting but this process is not ending
I tried system reboot multiple times, Reinstallation of different docker desktop versions but didn't help.
I found answers which mentioned to change the Preferences -> Settings and allocation of different memory and core to docker desktop here but settings page is also in endless loading state
Internet speed ~10MBps| mac OS 10.14 Mojave | 16GB RAM|. Please help fixing it
When Docker preference setting page is not working
Click on Docker desktop icon >> Preferences ( This page is not loading) >> Click on the Troubleshoot icon ( top right corner with a bug image placeholder) >> Reset to factory defaults
I've been trying so many things to make it work and the only thing that worked for me in Windows was running this in cmd
"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
I took this on Docker cannot start on Windows
Try this: Github Link it works for me!
I found a magical solution, first open the docker preferences settings, and then click the docker icon in the status bar to select restart. At this time, you will be surprised to find that the settings UI is no longer in the loading state, then select Kubernetes in this short time, cancel the enable Kubernetes option, finally click the application below and restart. docker returned to normal. All this should be caused by Kubernetes not starting normally.
Docker version 2.2.0.5
macOS High Sieera 10.13.6
On my side I had a similar issue on my Windows machine.
It was probably caused by a forced shutdown after sleep mode (perhaps no more battery).
I tried many things like restarting the Services but it was not working when I started to watch the folder .docker in my home directory.
I did this:
I first stopped my Docker Desktop process
then I deleted the file named .token_seed.lock in ${USER_HOME}/.docker/
Start the Docker Desktop from the shortcut
and after that my Docker was running without any issue and my stored images were correctly displayed (and starting / stopping properly).
Docker demon isn’t responding all your need is
Quit docker desktop.
force quit all docker processes in activity monitor (this should force stop the demon).
start docker desktop again.
I was having the same issue and what it solved it was to force Docker using Linux language. You can use this command for that:
'C:\Program Files\Docker\Docker\DockerCLI.exe' -SwitchLinuxEngine
1 - If you haven't already, follow Microsoft's Steps 4-6
https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
After setting up your distro
2 - Inside Docker Click on the Bug Icon (next to the settings top)
3 - Do Factory reset for Docker
4 - Stop Docker from Task Manager
5 - Run this command
'C:\Program Files\Docker\Docker\DockerCLI.exe' -SwitchLinuxEngine
6 - Now Launch Docker and it will work! hopefully.
If it doesn't (in step 3 I also deleted Containers, WSL settings, Hyper V) from Docker Settings (Be careful deleting your own Containers is dangerous)
I've just solved this problem.
I'm using docker on Ubuntu vmware.
I think, the cause is just docker engine is not started.
The solution is below:
This function is for virtual machine in the virtual machine.
Oh yes, so now we can run the docker engine successfully.
Of course, the "forever loading" problem has been solved.
I have encountered the exact same problem right after I added a key-value pair into the Docker daemon configuration file through the Docker Desktop -> Preferences -> Docker Engine tab. The change broke my Docker engine and I couldn't undo my changes through UI since the UI was broken and showing the loading animation.
I solved the problem by manually removing the changes I made. The daemon configuration file is located in ~/.docker/daemon.json.

How to remove Docker.Service from startup

Every time i start my computer, the Docker.Service service is loaded into my memory.
System: Windows 10 Pro 1903, Docker 2.0.0.3
I tried to avoid this by:
Disabling docker in the task manager startup tab
Disabling it in the Docker for Desktop itself
Removing all docker related entries from the Run / RunService folders in the registry
Still, Docker.Service appears in my task manager after restarting my computer.
How can i prevent my computer to load Docker.Service on startup?
For me this was annoying too and i have solved this by simply unticking the check box Start Docker Desktop when you login. This setting can be found if you right click on the whale in the tray and then go to settings > general.
If i now want to use Docker i have to manually start it.
You can also go to windows services WIN + R > services.msc and there you can manipulate the Docker Desktop Service. If it is configured to start automatically you can set this to manual in the properties of the service.

failing to start docker engine open //./pipe/docker_engine

I'm receiving the following error in docker on windows 10 laptop.
I've try to reinstall and restart but nothing helps.
The docker service is running OK but what i understand that i have a problem with the docker daemon (from what i read)
The whole issue started when i run the 2 commands:
net stop com.docker.service
net start com.docker.service
from there on i keep getting the error below and cannot solve it.
C:\Users\xxxx>docker images error during connect: Get
http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.30/images/json: open
//./pipe/docker_engine: The system cannot find the file specified. In
the default daemon configuration on Windows, the docker client must be
run elevated to connect. This error may also indicate that the docker
daemon is not running.
anyone succeed to solve it?
docker client must be run elevated to connect
This indicates that you do not have enough permissions. Try starting the terminal as administrator.
I run Docker remotely as a non admin user.
For this the user running docker should have full permission to location where Docker is installed.
User should be part of docker_users group
docker daemon runs on port 2375 by default. Try to whitelist this port. Allow incoming connections to 2375 in Windows Firewall settings
Restart your docker daemon and Docker service.
Restart the running Docker instance[Docker for Windows] if required. You do not have to reinstall.

Resources