devcontainer: enable audio playback

This commit is contained in:
zacaj
2025-11-23 18:02:53 +00:00
parent b1fe13ab9c
commit 2d6c4d7d1e
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
FROM mcr.microsoft.com/devcontainers/go:2-1.24-bookworm FROM mcr.microsoft.com/devcontainers/go:2-1.24-bookworm
RUN apt-get update && apt install -y libmpv-dev gcc libegl1-mesa-dev xorg-dev RUN apt update && apt install -y libmpv-dev gcc libegl1-mesa-dev xorg-dev acl
RUN usermod -aG audio vscode
USER vscode USER vscode
RUN go install fyne.io/fyne/v2/cmd/fyne@latest RUN go install fyne.io/fyne/v2/cmd/fyne@latest
+8
View File
@@ -14,6 +14,14 @@
"containerEnv": { "containerEnv": {
"VNC_RESOLUTION": "1920x1080x24", "VNC_RESOLUTION": "1920x1080x24",
}, },
"runArgs": [
"--device=/dev/snd:/dev/snd",
"--group-add=audio",
],
"postStartCommand": "sudo setfacl -m u:vscode:rw /dev/snd/*",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"onCreateCommand": { "onCreateCommand": {
"log": "echo 'Starting post-create script...'", "log": "echo 'Starting post-create script...'",
"go": ".devcontainer/init-go.sh", "go": ".devcontainer/init-go.sh",