Run a PipeWire server in Docker.
2.1K
Run a PipeWire server in Docker, that can either be fully isolated or communicate directly with the host's ALSA, with an optional PulseAudio interface.
See wojciech-graj/bluez-speaker-docker for an example of using this to create a bluetooth speaker.
The entire point of containerization is to require as little as possible from the host, so when deploying containers that use PulseAudio or PipeWire for audio playback on a headless system, there's no good reason to require the audio server to be installed on the host. By running it in a container, we reduce the setup needed when migrating to a new system.
compose.yaml pipewire:
image: wgraj/pipewire:latest
container_name: pipewire
environment:
- PUID=1000
- PGID=1000
cap_add:
- SYS_NICE
- IPC_LOCK
ulimits:
rtprio: 95
memlock: -1
volumes:
- ./pipewire-runtime:/pipewire # PipeWire/PulseAudio sockets
- /run/udev:/run/udev:ro # If using ALSA
devices:
- /dev/snd:/dev/snd # If using ALSA
You can then test that it works by running the following on the host:
PULSE_SERVER="unix:$(pwd)/pipewire-runtime/pulse/native" paplay /usr/share/sounds/alsa/Front_Center.wav
| Variable | Value | Default | Explanation |
|---|---|---|---|
PUID | Numeric | 1000 | Unix UID for the container user. |
PGID | Numeric | 1000 | Unix GID for the container user. |
USE_HOST_DBUS | 0/1 | 0 | Use the host's dbus. Requires mounting the /run/user/<UID>/bus:/pipewire/bus volume. |
ENABLE_PULSE | 0/1 | 1 | Run pipewire-pulse to provide a PulseAudio interface alongside PipeWire. |
BLUETOOTH_A2DP | 0/1 | 0 | Configure PipeWire to be a speaker instead of a headset over Bluetooth. |
Content type
Image
Digest
sha256:4b13e5569…
Size
64.9 MB
Last updated
5 days ago
docker pull wgraj/pipewire