This content originally appeared on DEV Community and was authored by Federico Navarrete
Most people are aware that Docker Desktop is not available anymore for Windows users for free, and this became a challenge. For a couple of months, I thought if there was any alternative for my team, and I came up with a solution using WSL2 and Ubuntu.
To get started you need to complete two requirements:
- Install Windows Subsystem for Linux 2 (it doesn't work with WSL1):
- Download Ubuntu from the Microsoft Store:
You can check if the version is correct with this:
wsl -l -v
And you must get something like this:
After this, you need to run this script in Ubuntu in three parts:
First part:
sudo apt-get update
Second part:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo apt-get install docker-compose
Third part:
Run this line to start your Docker every time you need it.
sudo dockerd
And that's all!
Banner credits:
This content originally appeared on DEV Community and was authored by Federico Navarrete
Federico Navarrete | Sciencx (2022-02-10T15:57:52+00:00) How to Compile Docker Images in Windows without Docker Desktop using WSL2. Retrieved from https://www.scien.cx/2022/02/10/how-to-compile-docker-images-in-windows-without-docker-desktop-using-wsl2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.