by moondev · 4y ago · 0 comments
I was surprised to find out wsl2 now supports systemd
https://devblogs.microsoft.com/commandline/systemd-support-i...
I was able to install docker normally inside wsl2 and it worked perfectly. No "desktop" app needed. This will be a game changer when it hits GA
We are looking into enabling systemd, though as said, this isn't GA yet. The functionality would only work for Win11, so we have to enable a win10 workaround for this (we have), but this has to be based on feature detection.
Arm binaries is being looked at, but can't commit to a timeframe when this will be delivered.
If you dont mind some tinkering, a fedora Aarch64 container base image can be imported to wsl2 to install podman.
You can install Docker following their Linux guide and then in your shell's profile file add:
if grep -q "microsoft" /proc/version &>/dev/null; then
if service docker status 2>&1 | grep -q "is not running"; then
wsl.exe --distribution "${WSL_DISTRO_NAME}" --user root \
--exec /usr/sbin/service docker start >/dev/null 2>&1
fi
fi
Basically the first time you open a terminal it'll pause for 5 seconds while the Docker daemon is started but it'll stay started for the duration of your Windows uptime even if you close your terminal. The next time you open a terminal it'll be instant.The experience is light-years ahead of the monstrosity that is Docker Desktop