When you install docker.io package, the guide tells you to create symlink to /usr/bin/docker.io
in /usr/local/bin/docker
. Then if you try to install latest version of Docker from docker.io repo, lxc-docker
- the installation will remove /usr/bin/docker.io
and symlink becomes invalid.
What you need to do to get it working again is to point symlink to /usr/bin/docker
:
ln -sf /usr/bin/docker /usr/local/bin/docker
After that everything will be working.
Does the new WLS spring update feature is enough to run Docker on WSL?
Microsoft does not support running the Docker daemon (also known as the service) within the WSL instance.
We frequently get asked about running docker from within the Windows Subsystem for Linux (WSL). We don’t support running the docker daemon directly in WSL. But what you can do is call into the daemon running under Windows from WSL. What does this let you do? You can create docker files, build them, and run them in the daemon—Windows or Linux, depending on which runtime you have selected—all from the comfort of WSL.
[Cross Post] WSL Interoperability with Docker
The Docker daemon can't run under WSL as it doesn't implement the necessary kernel ABI's. If you're running Docker for Windows, you are probably connecting to the Hyper-V virtual machine that it manages.
Is Docker running within WSL or connecting back to Windows?
While the daemon cannot run within a WSL instance, you can use the Docker CLI, to connect to a Docker service running on your Windows installation.
In the general settings, you’ll want to expose the daemon without TLS.
This step is necessary so that the daemon listens on a TCP endpoint.
If you don’t do this then you won’t be able to connect from WSL.
We still need to install Docker inside WSL because it’ll give us access to the > Docker CLI. We just won’t bother starting the server.
The following instructions are for Ubuntu but with the 2017 fall
update+ of Windows, WSL now supports a variety of distributions so if
you happen to use something other than Ubuntu then follow the Docker
installation guide for your distro from Docker’s installation docs.
This will install the edge channel, change ‘edge’ to ‘stable’ if you want. You may also want to update the Docker Compose version based on the latest release.
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=edge
export DOCKER_COMPOSE_VERSION=1.21.0
# Update the apt package index.
sudo apt-get update
# Install packages to allow apt to use a repository over HTTPS.
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# Add Docker's official GPG key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Verify the fingerprint.
sudo apt-key fingerprint 0EBFCD88
# Pick the release channel.
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
${DOCKER_CHANNEL}"
# Update the apt package index.
sudo apt-get update
# Install the latest version of Docker CE.
sudo apt-get install -y docker-ce
# Allow your user to access the Docker CLI without needing root.
sudo usermod -aG docker $USER
# Install Docker Compose.
sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose &&
sudo chmod +x /usr/local/bin/docker-compose
First up, open a WSL terminal because we need to run a few commands.
Create and modify the new WSL configuration file:
sudo nano /etc/wsl.conf
# Now make it look like this and save the file when you're done:
[automount]
root = /
options = "metadata"
If you get an error the next time you start your WSL terminal don’t freak out. It’s a bug with 18.03 and you can easily fix it. Hit CTRL+Shift+ECS to open task manager, goto the “Services” tab, find the “LxssManager” service and restart it.
Setting Up Docker for Windows and WSL to Work Flawlessly
Best Answer
you can try
sudo systemctl start docker
orsudo service docker start
in order to start the docker daemon, if it's already running typesudo systemctl status docker
orsudo service docker status
to see if there are some errors.Regards.