From 8676e254e29c030a28210877a1cf715799a44e16 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Mon, 10 Aug 2020 13:59:34 +0000 Subject: [PATCH] Fix CD drive permission issue with Docker (on ArchLinux) Fixes #499. Signed-off-by: JoeLametta --- Dockerfile | 5 ++++- README.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b0fbad..da967df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM debian:buster +ARG optical_gid RUN apt-get update && apt-get install --no-install-recommends -y \ autoconf \ @@ -51,8 +52,10 @@ RUN curl -o - 'https://ftp.gnu.org/gnu/libcdio/libcdio-paranoia-10.2+2.0.1.tar.b RUN ldconfig -# add user +# add user (+ group workaround for ArchLinux) RUN useradd -m worker -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 \ && chown worker: /output /home/worker/.config/whipper VOLUME ["/home/worker/.config/whipper", "/output"] diff --git a/README.md b/README.md index 677eed4..15594ad 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Please note that, right now, Docker Hub only builds whipper images for the `amd6 Alternatively, in case you prefer building Docker images 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): -`docker build -t whipperteam/whipper .` +`optical_gid=$(getent group optical | cut -d: -f3) docker build --build-arg optical_gid -t whipperteam/whipper .` It's recommended to create an alias for a convenient usage: