Minimal Debian-based Docker image that bundles PipeWire, WirePlumber, and ROC toolkit. Verified working for streaming and receiving audio over a network using UDP.
One line copy paste. Make sure to mount a folder pointing to your local pipewire config files.
docker run --rm -it \
--device /dev/snd \
-v "$(pwd)/pipewire.conf.d:/home/appuser/.config/pipewire/pipewire.conf.d" \
-p 10001:10001/udp \
-p 10002:10002/udp \
-p 10003:10003/udp \
-p 20001:20001/udp \
-p 20002:20002/udp \
-p 20003:20003/udp \
-e AUTO_LINK_SOURCE=seed-microphone-mono \
-e AUTO_LINK_TARGET=roc-sink \
-e PUID=$(id -u) \
-e PGID=$(id -g) \
-e AUDIO_GID=$(getent group audio | cut -d: -f3) \
pipewire-dockerThe total startup can take around 15 seconds. During that time you should see the following logs:
Starting system D-Bus as root...
Setting permissions for user {PUID}...
Switching to user {PUID}:{PGID} to start PipeWire and application...
[entrypoint] PipeWire stack launched
[entrypoint] Waiting for WirePlumber graph to link seed-microphone-mono → roc-sink
[entrypoint] Linked seed-microphone-mono → roc-sink
[entrypoint] Handing off to CMD: bash
You can automatically link audio devices using the AUTO_LINK_SOURCE and AUTO_LINK_TARGET environment variables:
-e AUTO_LINK_SOURCE=seed-microphone-mono
-e AUTO_LINK_TARGET=roc-sinkThis will wait for PipeWire to finish initializing, then it will run:
pw-link seed-microphone-mono roc-sinkHere is an example docker-compose which will automatically link my Raspberry Pi ReSpeaker 2-Mic to my roc-sink
To get your ID's
# audio
getent group audio | cut -d: -f3
# user
id -u
# group
id -g.env file
UID=1000
GID=1000
AUDIO_GID=29docker-compose.yml
services:
test:
image: pipewire-docker
container_name: debian-pipewire
devices:
- /dev/snd
restart: unless-stopped
volumes:
- ./pipewire.conf.d:/home/appuser/.config/pipewire/pipewire.conf.d
- pipewire_socket:/run/pipewire
environment:
- AUTO_LINK_SOURCE=seed-microphone-mono
- AUTO_LINK_TARGET=roc-sink
- PUID=${UID}
- PGID=${GID}
- AUDIO_GID=${AUDIO_GID}
- PIPEWIRE_RUNTIME_DIR=/run/pipewire
ports:
- "10001:10001/udp"
- "10002:10002/udp"
- "10003:10003/udp"
- "20001:20001/udp"
- "20002:20002/udp"
- "20003:20003/udp"
stdin_open: true
tty: true
volumes:
pipewire_socket:The default entry scripts sets up a dbus-daemon and sets permissions before using gosu to switch to the non-root user.
docker build -t pipewire-docker .