How to Compile Docker Images in Windows without Docker Desktop using WSL2

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….


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:

  1. Install Windows Subsystem for Linux 2 (it doesn't work with WSL1):

Install WSL | Microsoft Docs

  1. Download Ubuntu from the Microsoft Store:

Get Ubuntu - Microsoft Store

You can check if the version is correct with this:

wsl -l -v

And you must get something like this:

preview

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:

Linux Addicts


This content originally appeared on DEV Community and was authored by Federico Navarrete


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » How to Compile Docker Images in Windows without Docker Desktop using WSL2." Federico Navarrete | Sciencx - Thursday February 10, 2022, https://www.scien.cx/2022/02/10/how-to-compile-docker-images-in-windows-without-docker-desktop-using-wsl2/
HARVARD
Federico Navarrete | Sciencx Thursday February 10, 2022 » How to Compile Docker Images in Windows without Docker Desktop using WSL2., viewed ,<https://www.scien.cx/2022/02/10/how-to-compile-docker-images-in-windows-without-docker-desktop-using-wsl2/>
VANCOUVER
Federico Navarrete | Sciencx - » How to Compile Docker Images in Windows without Docker Desktop using WSL2. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/10/how-to-compile-docker-images-in-windows-without-docker-desktop-using-wsl2/
CHICAGO
" » How to Compile Docker Images in Windows without Docker Desktop using WSL2." Federico Navarrete | Sciencx - Accessed . https://www.scien.cx/2022/02/10/how-to-compile-docker-images-in-windows-without-docker-desktop-using-wsl2/
IEEE
" » How to Compile Docker Images in Windows without Docker Desktop using WSL2." Federico Navarrete | Sciencx [Online]. Available: https://www.scien.cx/2022/02/10/how-to-compile-docker-images-in-windows-without-docker-desktop-using-wsl2/. [Accessed: ]
rf:citation
» How to Compile Docker Images in Windows without Docker Desktop using WSL2 | Federico Navarrete | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.