Skip to content

Commit

Permalink
Parameterise the UID of the worker user in the docker build file.
Browse files Browse the repository at this point in the history
Signed-off-by: AlexJones <[email protected]>
  • Loading branch information
unclealex72 committed Nov 28, 2020
1 parent 660b28f commit 57997cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ARG uid=1000
FROM debian:buster
ARG optical_gid
ARG uid

RUN apt-get update && apt-get install --no-install-recommends -y \
autoconf \
Expand Down Expand Up @@ -55,7 +57,7 @@ RUN curl -o - "https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-${LIBCDIO_PARANO
RUN ldconfig

# add user (+ group workaround for ArchLinux)
RUN useradd -m worker -G cdrom \
RUN useradd -m worker --uid ${uid} -G cdrom \
&& if [ -n "${optical_gid}" ]; then groupadd -f -g "${optical_gid}" optical \
&& usermod -a -G optical worker; fi \
&& mkdir -p /output /home/worker/.config/whipper \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Building the Docker image locally is required in order to make it work on Arch L

To build the Docker image locally just issue the following command (it relies on the [Dockerfile](https://github.com/whipper-team/whipper/blob/develop/Dockerfile) included in whipper's repository):

`optical_gid=$(getent group optical | cut -d: -f3) docker build --build-arg optical_gid -t whipperteam/whipper .`
`optical_gid=$(getent group optical | cut -d: -f3) uid=$(id -u) docker build --build-arg optical_gid --build-arg uid -t whipperteam/whipper .`

It's recommended to create an alias for a convenient usage:

Expand Down

0 comments on commit 57997cb

Please sign in to comment.