This is for building a development environment using Podman in WSL2 and connecting it with VS Code. This particular dev environment installs Go. Could be generalized, and used as a base image for more specific dev environments.
Build and run development container:
sudo podman build -t devenv:latest -f ./.devenv/Dockerfile --build-arg USER_ID=$(id -u ${USER}) --build-arg GROUP_ID=$(id -g ${USER}) .
sudo podman run -dit -p 2278:22 -v ./:/usr/dev --name devenv devenv:latestThen connect using Visual Studo Code
Remote-SSH: Connect to Host Configure new host
ssh dev@localhost -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2278 devcontainer
Depends on a password for the dev account, which makes it weird to ssh as
devbut be your host user.Could be updated to generate an SSH key that is shared.