docker daemon can't running on ubuntu container - docker

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!

Related

Docker without docker dekstop. How to run Dockerfile

I want to run docker container on windows without docker desktop.
I dont know how it could work.
I installed Ubuntu on Windows (from Microsoft Store).
In Windows cmd i can write 'wsl' and then it brings me to Ubuntu cmd. In Ubuntu i installed Docker and its working.
Now I have project on Windows with Dockerfile. How can i run it ?
Because i have two systems Windows with my project and Linux with docker. What i have to do now to makes it works ?
Thanks
In your WSL navigate to your Dockerfile location. /mnt/c is the windows C: drive location inside the WSL. Build your Dockerfile with docker build. Run it with docker run. If the docker commands complain about the docker daemon not being reachable you need to start it with sudo service docker start.

I can't see containers in docker desktop - Ubuntu 22.04

So, I have Ubuntu 22.04
I installed Docker desktop and I can't see containers in docker desktop.
What should I do?
If you have tried to install docker from the terminal, it will disconnect the daemon from the WSL terminal, or even trying to set up systemd will do.
I suggest to clear data of your WSL, and to reinstall Docker.
This helped for me.

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

Cannot connect to the Docker daemon at tcp://localhost:2375

I have installed docker client on Windows Subsystem for Linux (WSL) on Windows 10.0.17763 Home.
When I run
sudo docker ps
I got:
Cannot connect to the Docker daemon at tcp://localhost:2375. Is the
docker daemon running?
and after removing docker environment variables (unset DOCKER_HOST , unset DOCKER_TLS_VERIFY , unset DOCKER_TLS_PATH), I still have the same issue with docker daemon:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is
the docker daemon running?
When I try to start docker daemon sudo systemctl start docker I am getting:
Failed to connect to bus: No such file or directory
docker version is 19.03.4
docker compose version is 1.24.1
Also restarting LxssManager win service will not help.
What should I do?
WSL is no real Linux Kernel which is why nothing, also running the Windows Subsystem for Linux as administrator by right clicking from start menu and running sudo service docker start does not work.
There is a new version, WSL 2 which is supposed to solve the docker issue but I did not try it our so far: https://docs.docker.com/docker-for-windows/wsl-tech-preview/

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