From 0685bd8dbb6f06a4581de7cd3345571004b001c3 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Mon, 18 Feb 2019 18:06:16 -0700 Subject: Basic running under non root user --- Dockerfile | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 321797f..c8057d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM ubuntu:18.04 - +FROM debian:sid-slim RUN apt-get update && apt-get install -y \ dirmngr \ @@ -8,31 +7,36 @@ RUN apt-get update && apt-get install -y \ && echo "deb http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu xenial main" >> /etc/apt/sources.list.d/firefox.list \ && apt-get update && apt-get install -y \ firefox \ + apulse \ ffmpeg \ pulseaudio \ + libasound2 \ libgl1-mesa-glx \ + libpulse0 \ dbus-x11 \ sudo RUN /bin/bash -# ENV UNAME thorny +ENV UNAME thorny +ENV UID 1000 +ENV GID 985 # # Set up the user -# 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 && \ +RUN export UNAME=$UNAME UID=$UID 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 + +RUN chown thorny:thorny /home/thorny # 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 -# ENV HOME /home/thorny -# WORKDIR /home/thorny -# # I don't know why the chown doesn't persist when added above -# CMD sudo chown thorny:thorny -R /home/thorny && /bin/bash +USER $UNAME +ENV HOME /home/thorny +WORKDIR /home/thorny +CMD /bin/bash -- cgit v1.2.3