Docker desktop is stuck on "Docker Desktop starting..." on Windows 10 - docker

I've tried
Uninstall Docker
Restart machine
Installed a linux WLS distro: wsl --install -d Ubuntu
Installed Docker again

Related

ROS Melodic into Docker Ubuntu 18.04

I have installed Ubuntu 18.04 container and got error while adding ros melodic there.
E: Unable to locate package ros-melodic-desktop-full
Neither ros-melodic nor ros-melodic-desktop.
Should I just get installed Ubuntu 18.04 as second OS next to Ubuntu 20.04 or set into VM?
I have managed to pull the ros-meldoic using those commands in my ubuntu 18.04
docker pull ros:melodic
docker pull osrf/ros:melodic-desktop-full // for GUI tool
To run something,
docker run -it --rm osrf/ros:melodic-desktop-full roscore
Note: Melodic is not supported on Ubuntu Focal (20.04) and that's why docker is a good alternative

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]

I saw similar treads but they are different because I am using WSL2 and docker and GPU aware docker.
I have windows 10 version 2004 (build 20161.1000)
I have installed WSL 2 and have Docker Desktop 2.3.0.3 on my Windows System running.
I have Ubuntu 18.04 LTS installed in WSL 2 too.
I have installed the NVIDIA driver
The linux version is 4.19.121-microsoft-standard.
The NVIDIA driver version is 455.41 for my Laptop GPU QUADRO M2000M.
Actually I followed all the steps described in https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2 until the step where I have to run "sudo service docker stop" in an Ubuntu terminal.
This results in a message docker: unrecognized service.
I have to restart docker desktop in WIndows 10 in order to get the deamon running.
I test then in the Ubuntu terminal : docker run hello-world ==> this runs fine
Also the command docker run -it ubuntu bash ==> runs file in the Ubuntu terminal os WSL 2.
BUT when I run :
docker run -u $(id -u):$(id -g) -it --gpus all -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3-jupyter
then I get the error : docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]
This invoves microsoft,Ubuntu,NVIDIA. I have search the support sites but could not find anything that solves my prblem.
Can anyone help me here?
There is this strange answer mentioned here and here:
sudo service docker start
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
This worked for me on WSL (Ubuntu 20.04), so I added it to the ~/.bashrc script.
Note, the first part may need to be restarting docker!

How to run docker-compose under WSL 2

According to Docker documentation, using Docker under WSL v2 should be fairly simple:
Install WSL 2 (make sure all the preconditions are met);
Install Docker Desktop 2.2.0 or newer;
In Docker Settings > General enable 'Expose daemon on tcp://localhost:2375 without TLS' and 'Enable the experimental WSL 2 based engine';
Make sure no Docker-related packages are installed in your Linux file system.
Once all this is done, I should be able to run docker or docker-compose commands from my Linux Terminal. But I'm not. I keep getting Command 'docker' not found, but can be installed with sudo apt install docker.io'.
What am I doing wrong?
Did you check if the integration is enabled in Resources > WSL Integration as below?
Have you made sure that wsl2 is enabled for your distro? Run this in Powershell
wsl -l -v
If your distro is not on WSL 2 then enable it like this.
wsl --set-version <Distro> 2
Install docker and docker-compose.
Type in the terminal:
sudo service docker start
sudo service --status-all | grep '+'

Docker issues on Mac

I installed docker using HomeBrew on Mac.
➜ mattermost-server git:(master) docker --version
Docker version 18.09.1, build 4c52b90
➜ mattermost-server git:(master) which docker
/usr/local/bin/docker
When I run docker,
This is the error I get.
➜ mattermost-server git:(master) docker ps
Cannot connect to the Docker daemon at **unix:///var/run/docker.sock.
Is the docker daemon running?**
Update: This can be solved by removing existing docker and running
brew install cask docker
Refer here Cannot connect to the Docker daemon on macOS
I had the same problem after install docker on my mac (brew cask install docker).
docker --version works, but docker ps or any other docker command results in the error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
To solve the problem you have to :
Install Virtual Box
run : docker-machine create default to create a virtual machine (mandatory
on mac os)
run: docker-machine env default to set the environment
run: eval $(docker-machine env default)
try docker ps or docker version to check that everything is ready.
You are possibly running docker without sudo user, aren't you?
By default you should run docker with sudo user, if you don't want to do that, folow Manage Docker as a non-root user
We need to run brew cask install docker. This should fix the problem.

docker-compose is not working

When I am trying to test a zookeeper cluster using docker-compose, the console shows nothing.
This is my command:
COMPOSE_PROJECT_NAME=zk_test docker-compose up
No response of docker-compose command
My questions are:
I only installed docker-machine and docker-compose. The command is there, but do I need to install docker-compose additionally?
Should docker-compose be installed inside docker machine or in host machin? If the latter, how does docker-compose manage Docker containers? Because they are running inside of the Docker machine.
What I think is weird, is that when I input 'docker-compose' in the host terminal, it can be recognized by the OS (screenshot).
My environment:
OS: Mac
Docker container: docker-machine (boot2docker)
Here is how I get all necessary packages on my Mac OS machine.
Install homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then brew cask install docker
brew cask install docker
Open Docker through Applications or:
open /Applications/Docker.app
You should now how docker-compose, docker and docker-engine.

Resources