Support custom Fedora-based WSL2 distributions. The distributions are built based on custom Fedora 32+ Docker images from which the filesystem is exported as a tarball.
> ./build.sh -?
Usage:
build.sh [--version <version>][--user <user>][--distro <distroType>][--sshPub <pubKey>][--sshPriv <privKey>]
--version=<version> - Fedora version (32+)
--user=<user> - specify the non-root username which will be created with sudo access
--distro=<distroType> - specify the type of distro to build:
- base - minimal Fedora distro
- podman - Fedora distro with Podman, Buildah (NOTE: work in progress)
- cpp - C++ development
--sshPub=<pubKey> - specify an existing ssh public key file to insert in user's .ssh directory
--sshPriv=<privKey> - specify an existing ssh private key file to insert in user's .ssh directory
The tarball then can be imported as a WSL distribution from Powershell:
> wsl --import Base /path/to/<baseWslDir> wsl-fedora32-base.tar
OR
> wsl --import Podman /path/to/<podmanWslDir> wsl-fedora32-podman.tar
This is a small image based on the Fedora 32+ Docker base image
This image is based on the Fedora 32+ Docker base image with packages added to support Podman and Buildah.
Thanks to Jonathan Bowman's post for identifying steps to get rootless Podman working under WSL2.
This image adds C++ development tools
The alternative way to achieve container support within a WSL2 distro is as follows:
- Install Docker Desktop for Windows, and enable the WSL2 backend.
- Import the Fedora WSL2 distro as shown above.
- From the Docker Desktop select Settings -> General -> WSL Integration and choose the Fedora WSL2 distro which was imported. This will create the
/usr/bin/docker
symlink and add thedocker
group in/etc/group
. - Start the Fedora WSL2 distro.
- As root or via
sudo
add the non-root user to thedocker
group in/etc/group
.