Install Docker in WSL 2 without Docker Desktop

preview_player
Показать описание
It only takes a few lines of shell scripting and there's Kubernetes support too.

Hit the subscribe button to receive more videos like this!

REFERENCE LINKS
---------------------------------------------------

COURSES
---------------------------------------------------
Courses I've created that focus on web dev and deployment topics.

THE TOOLS I USE / GEAR
---------------------------------------------------

FOLLOW ME ELSEWHERE
---------------------------------------------------

TIMESTAMPS
---------------------------------------------------
0:00 -- Intro
0:22 -- Everything runs smoothly with this set up
0:53 -- Why I ended up switching away from Docker Desktop
3:18 -- Switching away has nothing to do with Docker Desktop license costs
3:56 -- Why you might want to continue using Docker desktop
6:01 -- You can still run a Kubernetes cluster locally if you want
7:09 -- Following the Docker Linux install guides
8:25 -- Adding your WSL 2 user to the Docker group to run Docker without sudo
9:44 -- Install Docker Compose v2 with the Docker plugin
10:44 -- Now we need to run the Docker service within WSL 2
11:19 -- A tiny bit of shell scripting to ensure Docker is started
15:43 -- How are you running Docker within WSL 2?
Рекомендации по теме
Комментарии
Автор

If you're using Ubuntu 22.04 or Debian 10 / 11 you'll need to make 1 small change from the video. You'll need to run `sudo update-alternatives --config iptables` and choose option (1) from the prompt to install the legacy version of iptables. Once that's installed everything else works 100% the same and Docker will start successfully.

NickJanetakis
Автор

Thank you so much! I was struggling with Docker Desktop. This solution worked wonders!

leTRodz
Автор

Very helpful, thanks mate! I've been struggling to get docker to work without docker-desktop on linux

thatokhunou
Автор

Thanks for the video! I will definitely install docker derectly into WSL2, because I have never used GUI, k8s feature

nnutipa
Автор

That helped a lot. Thanks for sharing.

cacanantes
Автор

super clear and you addressed all doubts. came here cuz apparently docker-desktop is causing vmmem to max out memory usage. thanks!

wuziq
Автор

Thanks much dood. it's working perfectly.

vpsvbeb
Автор

Hey Nick, thanks for the tutorial! systemd support in now available on WSL.

aytraf
Автор

Thanks for the video men, is very usefull

JaviHabana
Автор

Thanks for taking the time to explain the ins and outs of this. I did not even know we had a choice. I just re-installed my 3 year old 9570 and chose to stay away from DDesktop. Volumes really seem faster.
One small thing I will miss is the neat log/terminal pane in the DDesktop container GUI. But Docker Desktop feels like a nuclear powerplant in terms of footprint and I can probably easily add some aliases to my .bashrc to the same effect.

On a side note: you mention that your workstation has 16G of RAM. I do not know the type of workflows that you're running, but I have a 32G and 64G machine and the 32G machine sometimes runs a bit short on memory (WSL2 eats memory like pandas on a bamboo gobbling spree) .

golvino
Автор

Holy crap slowing this video down to .75x makes the dialog seem pretty much normal speed.

EbonySeraphim
Автор

Great video! I studying up on Docker Swarm and was wondering if it is possible to run multiple instances of docker on the same machine to simulate a swarm environment. Is it possible to extend what you describe to run the service multiple times?

gc-ybfr
Автор

Thanks for the video.
I did all the steps from video and document. But still my docker daemon is not running. I added script in .profile folder also.
Any help would be really appreciated.
Thanks!

saivinherkar
Автор

This is amazing. One follow-up question after I've got it running now.

I have a 100Gb SSD C: drive that's like 95% full and an 800 Gb spinning drive that's only like 10% full. How can I store all these images on my spinning drive that still has tons of room on it?? 🙏

brianholland
Автор

Is the docker on wsl free to use if i am working in a company that doesnt fit in free usage policy for docker desktop

sanlues
Автор

Can't broadcast in Lan network

Whenever we run docker container (docker desktop on windows or docker cli on linux) using broadcast IP 0.0.0.0 & bind port, it gets accessible throughout the local network

But in this method it does not
Do we have a solution to that

caliberx
Автор

great video. thank, you. Not sure if i accidently hit the 1.5x speed button or you ingested 1.5 buttons of speed.

ryanbarnds
Автор

Thanks for your tutorial. Could you tell me more about how to connect to the installed docker from another computer (they are all in the same network). I tried but it seem I can only access my app using "localhost" not the "ip" of the computer I installed wsl

zcjgliq
Автор

Hi, Nick! In Docker Desktop we can change preferences to mount specific folders in File Sharing. How can I change this preferences using Docker in WSL?

nataliamarquesvieira
Автор

Have you ever run into an issue where once docker starts you can't access the net from your wsl2 instance? For example you can start a ping and let it run, start docker (in a different terminal window) and a few seconds later the ping will stall, nslookup etc will also fail for anything outside of wsl2. It's very annoying, had been working fine for months prior to this happening. I suspect something in an update/upgrade modified or does not like my config. Using win 11/ Ubuntu 22.04 with systemd. It was auto starting but disabled it to troubleshoot the issue.

deyeaus