Developing GUI App (Bevy) in VSCode DevContainer (Wayland)
I wanted to experiment with developing a game using the Bevy Engine, but didn't want to install a bunch of dependencies on my computer. I wanted to keep things contained in a VS Code Dev Container. The tricky part was getting Wayland support working for the demos.
This required crafting a slightly custom Dockerfile and devcontainer.json.
First, I enabled Wayland socket binding in vscode by going into Settings and enabling "Mount Wayland Socket":
Here's the Dockerfile I'm using, although it has several unnecessary packages for just adding Wayland support. Several of these are for x11.
That should be enough to get Wayland access inside the container. x11 apps should work too.
Modify Cargo.toml to include Wayland support in Bevy: