Using Podman with Devpod

#podman#devpod#devcontainers#notes

Configure devpod to use Podman as default provider.

Using Podman with Devpod

Install Devpod

Terminal window
## Official "Abandoned ware?"
curl -L -o devpod "https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod
## Active Community Fork
curl -L -o devpod "https://github.com/skevetter/devpod/releases/latest/download/devpod-linux-amd64" && sudo install -c -m 0755 devpod /usr/local/bin && rm -f devpod

Now, configure devpod to use podman as default provider.

Terminal window
devpod provider add docker
devpod provider set-options docker -o DOCKER_HOST="unix://$(podman info --format '{{.Host.RemoteSocket.Path}}')"
devpod provider set-options docker -o DOCKER_PATH=$(which podman)
devpod provider options
ln -s /usr/sbin/podman ~/.local/bin/docker

Fix UID-mapping issues on rootless bind mounts

#podman#devpod#devcontainers#notes

DevPod tries to chown files to a specific user (like UID 1000) inside the container, those files may appear as a high, inaccessible UID on host. To address this issue use userns=keep-id to tell the container to map your host UID to the same UID inside the container

"runArgs": [
"--userns=keep-id:uid=1000"
]

Other Solutions:

set the remoteUser

"remoteUser": "root"

disable Automatic UID ipdates

"updateRemoteUserUID": false

Fix existing permission erros

change ownership within the same user namespace as the container, effectively mapping them back to the host user

Terminal window
podman unshare chown -R 0:0 /path/to/your/workspace