[openstreetmap/openstreetmap-website] Support for Development Containers (devcontainers) (PR #6424)
Pablo Brasero
notifications at github.com
Fri Oct 31 14:54:49 UTC 2025
pablobm left a comment (openstreetmap/openstreetmap-website#6424)
OK... I tried with VSCodium this afternoon and it definitely was not as straightforward as with VS Code, having to install DevPod manually and all. Also depending on the setup it may require you to manually ssh into the container.
Tried VSCodium with virtual machines:
- With Fedora I couldn't get it to work properly as I couldn't access the Internet from within the container and therefore couldn't run `bundle install` and so on. Perhaps a firewall setting in Fedora?
- With Debian I got it working.
I'm pasting a script below that I used to spare me repetitive installs in the VMs. It may help others get up and running:
```
# Debian/Ubuntu
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove -y $pkg; done
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
| gpg --dearmor \
| sudo dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
echo -e 'Types: deb\nURIs: https://download.vscodium.com/debs\nSuites: vscodium\nComponents: main\nArchitectures: amd64 arm64\nSigned-by: /usr/share/keyrings/vscodium-archive-keyring.gpg' \
| sudo tee /etc/apt/sources.list.d/vscodium.sources
sudo apt update && sudo apt install codium
sudo apt install -y fuse libfuse2 libopengl0 libfribidi0 libgles2-mesa-dev
# Fedora
sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
sudo dnf -y install dnf-plugins-core
sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h\n" | sudo tee -a /etc/yum.repos.d/vscodium.repo
sudo dnf install codium
sudo dnf install fuse fuse-libs libglvnd-egl libglvnd-opengl libglvnd-glx harfbuzz fontconfig fribidi libthai
# Common
sudo usermod --append --group docker $(whoami)
sudo reboot
mkdir -p ~/.local/bin
curl -L -o devpod "https://github.com/loft-sh/devpod/releases/latest/download/devpod-linux-amd64" && sudo install -c -m 0755 devpod ~/.local/bin && rm -f devpod
devpod provider add docker
devpod provider use docker
sudo reboot
cd Documents
git clone https://github.com/pablobm/openstreetmap-website
cd openstreetmap-website
git checkout devcontainer
codium .
# Manually
# 1. Install "DevPod Containers" extension
# 2. A toast notification may invite to "Reopen in Container". Go for it. If not, find the command "DevPod: Reopen in Container".
```
I'm sure I don't need to say not to run it all at once! :wink: Apart from not being thoroughly tested, it includes steps for Debian/Ubuntu and Fedora, as well as two `reboot` lines. You may need to install Git first too (I used VM snapshots that already had it installed).
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6424#issuecomment-3473449305
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6424/c3473449305 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251031/8284efbf/attachment.htm>
More information about the rails-dev
mailing list