share pulseaudio

This commit is contained in:
ale 2020-05-29 19:11:38 +02:00
parent 6ec12a8a8f
commit 007167f4cb
4 changed files with 29 additions and 5 deletions

View File

@ -9,6 +9,11 @@ Needs `docker` and `docker-compose`
xhost +"local:docker@" xhost +"local:docker@"
``` ```
### Change your local user UID in the next line of `docker-compose.yml` for pulseaudio (default 1000)
```
- /run/user/[UID]/pulse:/run/user/1000/pulse
```
### Execute with compose ### Execute with compose
``` ```
docker-compose up -d docker-compose up -d

View File

@ -6,6 +6,9 @@ services:
hostname: wahay hostname: wahay
container_name: wahay container_name: wahay
environment: environment:
- DISPLAY - DISPLAY=unix$DISPLAY
- PULSE_SERVER=unix:/run/user/1000/pulse/native
volumes: volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:ro - /tmp/.X11-unix:/tmp/.X11-unix:ro
- /run/user/1000/pulse:/run/user/1000/pulse
- ./wahay/pulseaudio.client.conf:/etc/pulse/client.conf:ro

View File

@ -1,8 +1,18 @@
FROM golang FROM golang
RUN apt update && apt upgrade -y && apt install -y curl lsb-release dirmngr ENV UNAME mumble
RUN apt update && apt upgrade -y && apt install -y curl lsb-release dirmngr pulseaudio-utils && apt clean
RUN curl -s https://dl.autonomia.digital/debian/keys.asc | apt-key add - RUN curl -s https://dl.autonomia.digital/debian/keys.asc | apt-key add -
RUN echo deb https://dl.autonomia.digital/debian $(lsb_release -c | cut -f 2) main | tee /etc/apt/sources.list.d/wahay.list RUN echo deb https://dl.autonomia.digital/debian $(lsb_release -c | cut -f 2) main | tee /etc/apt/sources.list.d/wahay.list
RUN echo deb-src https://dl.autonomia.digital/debian $(lsb_release -c | cut -f 2) main | tee -a /etc/apt/sources.list.d/wahay.list RUN echo deb-src https://dl.autonomia.digital/debian $(lsb_release -c | cut -f 2) main | tee -a /etc/apt/sources.list.d/wahay.list
RUN apt update && apt install -y wahay RUN apt update && apt install -y wahay && apt clean
RUN export UNAME=$UNAME UID=1000 GID=1000 && \
mkdir -p "/home/${UNAME}" && \
echo "${UNAME}:x:${UID}:${GID}:${UNAME} User,,,:/home/${UNAME}:/bin/bash" >> /etc/passwd && \
echo "${UNAME}:x:${UID}:" >> /etc/group && \
mkdir -p /etc/sudoers.d && \
echo "${UNAME} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${UNAME} && \
chmod 0440 /etc/sudoers.d/${UNAME} && \
chown ${UID}:${GID} -R /home/${UNAME} && \
gpasswd -a ${UNAME} audio
USER ${UNAME}
ENTRYPOINT [ "wahay" ] ENTRYPOINT [ "wahay" ]

View File

@ -0,0 +1,6 @@
default-server = unix:/run/user/1000/pulse/native
# Prevent a server running in the container
autospawn = no
daemon-binary = /bin/true
# Prevent the use of shared memory
enable-shm = false