Browse Source

Configurable user parameters (#2)

Update README

Configurable user parameters

Co-authored-by: Francesc Gordillo <yenien@posteo.net>
Reviewed-on: http://gitea.hatthieves.es/manalejandro/docker-wahay/pulls/2
master
yenien 3 years ago
committed by manalejandro
parent
commit
52c13625d7
4 changed files with 26 additions and 10 deletions
  1. +1
    -0
      .gitignore
  2. +6
    -4
      README.md
  3. +9
    -3
      docker-compose.yml
  4. +10
    -3
      wahay/Dockerfile

+ 1
- 0
.gitignore View File

@ -0,0 +1 @@
.env

+ 6
- 4
README.md View File

@ -9,9 +9,11 @@ Needs `docker` and `docker-compose`
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
### Add your local user UID and GID in the `.env` file:
```bash
echo "UID=${UID}" > .env
echo "GID=${UID}" >> .env
```
### Execute with compose
@ -21,4 +23,4 @@ docker-compose up -d
### License
MIT
MIT

+ 9
- 3
docker-compose.yml View File

@ -1,8 +1,14 @@
version: "2"
version: "3"
services:
wahay:
build: ./wahay
build:
dockerfile: ./wahay/Dockerfile
context: .
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
UNAME: ${UNAME:-mumble}
hostname: wahay
container_name: wahay
environment:
@ -10,5 +16,5 @@ services:
- PULSE_SERVER=unix:/run/user/1000/pulse/native
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:ro
- /run/user/1000/pulse:/run/user/1000/pulse
- /run/user/${UID:-1000}/pulse:/run/user/${UID:-1000}/pulse
- ./wahay/pulseaudio.client.conf:/etc/pulse/client.conf:ro

+ 10
- 3
wahay/Dockerfile View File

@ -1,11 +1,18 @@
FROM golang
ENV UNAME mumble
ARG UID=1000
ARG GID=1000
ARG UNAME=mumble
ENV UID=${UID} \
GID=${GID} \
UNAME=${UNAME}
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 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 apt update && apt install -y wahay && apt clean
RUN export UNAME=$UNAME UID=1000 GID=1000 && \
RUN export UNAME=$UNAME UID=$UID GID=$GID && \
mkdir -p "/home/${UNAME}" && \
echo "${UNAME}:x:${UID}:${GID}:${UNAME} User,,,:/home/${UNAME}:/bin/bash" >> /etc/passwd && \
echo "${UNAME}:x:${UID}:" >> /etc/group && \
@ -15,4 +22,4 @@ RUN export UNAME=$UNAME UID=1000 GID=1000 && \
chown ${UID}:${GID} -R /home/${UNAME} && \
gpasswd -a ${UNAME} audio
USER ${UNAME}
ENTRYPOINT [ "wahay" ]
ENTRYPOINT [ "wahay" ]

Loading…
Cancel
Save