Browse Source

Configurable user parameters

pull/1/head
Francesc Gordillo 4 years ago
parent
commit
ffafa8218b
No known key found for this signature in database GPG Key ID: A4F3669C5B80A7AF
3 changed files with 19 additions and 5 deletions
  1. +1
    -0
      .gitignore
  2. +8
    -2
      docker-compose.yml
  3. +10
    -3
      wahay/Dockerfile

+ 1
- 0
.gitignore View File

@ -0,0 +1 @@
.env

+ 8
- 2
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
- 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