docker desktop windows won't install docker daemon for wsl2 - docker

[x] I have tried with the latest version of my channel (Stable or Edge)
[x] I have uploaded Diagnostics
Diagnostics ID: 8C2E2B56-0E86-4E49-BAF5-B06DB3F99738/20200712115912
Expected behavior
sudo service docker command ran on wsl2 (4.19.121-microsoft-standard) should print service status
Actual behavior
sudo service docker command prints docker: unrecognized service
Information
Windows Version: 20161.1000, Windows Feature Experience Pack 120.16201.0.0
Docker Desktop Version: 2.3.0.3 (45519)
Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: nope
I followed instructions in docker documentation page for wsl so docker can installed to my windows, and checked the command docker run -d -p 80:80 docker/getting-started on ubuntu running successfully, but the service command won't work as described above.
Steps to reproduce the behavior
follow the instructions in here
sudo service docker on wsl2 ubuntu

Related

I can't open Docker Desktop in Ubuntu 18.04

When i try to open Docker Desktop app i see that in systemd.
And Docker Desktop doesn't start too.
$ /usr/lib/systemd/user/docker-desktop.service:8: Failed to parse service type, ignoring: exec
$ graphical-session.target: Unit not needed anymore. Stopping.

docker daemon can't running on ubuntu container

On my windows 11, I install Docker Desktop and ubuntu image.
On ubuntu container, I want install dapr,but dapr depends on docker
dapr init
⌛ Making the jump to hyperspace...
❌ could not connect to Docker. Docker may not be installed or running
so, then I install docker on ubuntu container, but the docker can't run (I have set export DOCKER_HOST=tcp://127.0.0.1:2375). how to solve this issue? Thanks!

Docker Swarm, Windows Containers, ingress network (Routing Mesh) on Windows Server 2019

I want to build docker swarm cluster on windows. To do this I choose Windows Server 2019 in 1809 Version. I work on my local machine and using Vagrant box vm.box=StefanScherer/windows_2019 I created enviroment for developing purposes.
Set Hostname.
Set private network (192.168.52.100)
Install Docker-EE
On this Windows I have installed docker-ee by using command Install-Package Docker -ProviderName DockerMsftProvider -RequiredVersion 19.03 -Force, and docker work perfectly.
docker version return everething ok
docker run -it --rm -p 8000:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/core/samples:aspnetapp -> also work perfectly.
My first issue is when I perform command docker swarm init --advertise-addr=192.168.52.100 I notice my internet connection is lost for a while (also init/join/leave).
And the secound issue is routing mesh, it is not working
Steps to reproduce:
docker service create --publish published=8050,target=80,mode=ingress --name aspnetcore_sample mcr.microsoft.com/dotnet/core/samples:aspnetapp
Open web browser http://127.0.0.1:8050/ (on machine where I init swarm)
Now I should have access to this sample app under 8050 port. But http://127.0.0.1:8050/ is not working
I know I can use mode=host but I think mode=ingress should work.
I also checked it with the same commands on linux and it works without any problem
How can I resolve this issue?

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Linux Bash Shell on windows 10

I am new to Docker. I'm trying to work with it on windows.
I have Windows 10 Family so I installed Linux Bash Shell.
When I run this command:
$ docker run hello-world
I get :
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
And when I run
$ systemctl status docker
I get
System has not been booted with systemd as init system (PID 1). Can't operate
For anyone using WSL2 and seeing an identical error message, look at https://github.com/MicrosoftDocs/WSL/issues/457#issuecomment-511495846
Powershell
wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
Ubuntu
$ docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
$ systemctl status docker
System has not been booted with systemd as init system (PID 1). Can't operate.
$ sudo /etc/init.d/docker start
* Starting Docker: docker [ OK ]
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
It seems like you wont be able to use docker in Windows 10 family, since docker Desktop requires specific Windows version, as said in official documentation.
System Requirements
Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later).
What you can try is to run linux-based virtual machine on you Windows host, and run docker inside of it. But even if you succeeded, you will lose all advantages of the docker in resources consumption.
Just run the Docker Daemon with.
sudo dockerd &
The sudo make it run as super user.
Dockerd is DOCKERDaemon
The single & at the end just make it run in the background.
The issue here is that from the error message, it states that you are using WSL (Windows Sub-system for Linux Version 1), this version did not have Docker support as it is not a full Linux kernel, but an translation layer between a Linux user-space and then translated to Windows Kernel commands.
Running the wsl --list -v command will show you the version you are using:
You can install WSL version 2, which has a Microsoft provided full Linux Kernel running using Hyper-V infrastructure (but not full Hyper-V). This way it runs on Windows Home, Education, and Professional. And here you can run a Linux Instance and the install Docker.
Windows Subsystem for Linux Installation Guide

Docker on ubuntu app for windows 10 starting but not running

I have a windows 10 enterprise laptop.
Installing docker on that machine in the past proved unsuccessful.
As an alternative I have installed the ubuntu app from microsoft store, ubuntu version Ubuntu 18.04.1 LTS.
I then followed the tutorial to install docker ce on ubuntu and everything went smoothly up to running an app.
I installed Docker version 18.09.6, build 481bc77
I did the post-installation for unix, logout using exit and restarted.
It looks like I can start docker:
~$ sudo service docker start
* Starting Docker: docker
But when checking if docker is running for real, it seems that it is not the case:
~$ ps
PID TTY TIME CMD
4 tty1 00:00:00 bash
328 tty1 00:00:00 ps
It is confirmed with the error message when running the hello world image:
$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Is there specificity with Ubuntu app for windows that prevent me from running docker?
Edit: thanks to #atline link, it is mentioned windows does not support running docker daemon within the WSL.
I cannot run docker desktop and hit a wall on below issue closed without being resolved:
https://github.com/docker/for-win/issues/74
You can use this command:
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$PATH:/mnt/c/Program Files/Docker/Docker/resources/bin"
alias docker=docker.exe
alias docker-compose=docker-compose.exe

Resources