- 1 year ago
Installing Docker On Ubuntu App For Windows
To install Docker on the Ubuntu App for Windows (WSL), you can follow these steps:
Install WSL: If you haven't already, install the Windows Subsystem for Linux (WSL) by following the official Microsoft documentation: https://docs.microsoft.com/en-us/windows/wsl/install-win10
Install Ubuntu: Open the Microsoft Store and search for "Ubuntu." Install the Ubuntu distribution of your choice. This will be the Ubuntu App for Windows.
Launch Ubuntu: After installation, launch the Ubuntu App from the Start menu or by searching for "Ubuntu." It will open a Linux shell within Windows.
Update Ubuntu: In the Ubuntu shell, run the following commands to update the package lists and upgrade installed packages:
sqlsudo apt update
sudo apt upgrade
Install Docker: Run the following commands to install Docker on Ubuntu within WSL:
bashsudo apt install docker.io
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
Configure Docker to work with WSL: Open a new terminal (Ctrl+Shift+T) and run the following command to configure Docker to use the WSL backend:
bashecho "export DOCKER_HOST=unix:///var/run/docker.sock" >> ~/.bashrc
source ~/.bashrc
Test Docker: Verify that Docker is installed and working correctly by running the following command:
docker version
You should see the Docker client and server versions displayed.
Now you have Docker installed within the Ubuntu App for Windows (WSL). You can use Docker commands within the Ubuntu shell just as you would on a native Linux environment.
Please note that since the Ubuntu App for Windows is running in WSL, it has its own isolated Linux kernel and runs alongside Windows. It does not provide direct access to the Windows Docker engine. If you want to use Docker from the Windows command prompt or PowerShell, you will need to install Docker Desktop for Windows separately.