Skip to content
Snippets Groups Projects
Commit 135ccbb3 authored by Samuel MARTIN MORO's avatar Samuel MARTIN MORO
Browse files

fix(pebkac)

parent a6db3197
Branches
Tags
No related merge requests found
ARG DEF_USERID=1001
ARG FFMPEG_VERSION=4.2.2 ARG FFMPEG_VERSION=4.2.2
FROM ubuntu:bionic FROM ubuntu:bionic
...@@ -22,9 +21,9 @@ RUN apt-get update && apt-get install -y \ ...@@ -22,9 +21,9 @@ RUN apt-get update && apt-get install -y \
alsa-oss \ alsa-oss \
pulseaudio \ pulseaudio \
pulseaudio-utils \ pulseaudio-utils \
&& mkdir /home/lithium \ && mkdir /home/lithium /var/run/pulse /run/user/lithium \
&& chown -R ${DEF_USERID}:0 /home/lithium && chown -R 1001:0 /home/lithium /run/user/lithium /var/run/pulse \
&& chmod -R g=u /home/lithium /run/user/lithium /var/run/pulse
RUN ln -s /usr/bin/python3 /usr/local/bin/python \ RUN ln -s /usr/bin/python3 /usr/local/bin/python \
&& pip3 install --upgrade pip && pip3 install --upgrade pip
...@@ -68,4 +67,4 @@ COPY nsswrapper.sh ./ ...@@ -68,4 +67,4 @@ COPY nsswrapper.sh ./
ENTRYPOINT ["sh","docker-entrypoint.sh"] ENTRYPOINT ["sh","docker-entrypoint.sh"]
CMD ["sh","startStream.sh" ] CMD ["sh","startStream.sh" ]
USER ${DEF_USERID} USER 1001
...@@ -5,19 +5,18 @@ if test "`id -u`" -ne 0; then ...@@ -5,19 +5,18 @@ if test "`id -u`" -ne 0; then
echo Skipping nsswrapper setup - already initialized echo Skipping nsswrapper setup - already initialized
else else
echo Setting up nsswrapper mapping `id -u` to lithium echo Setting up nsswrapper mapping `id -u` to lithium
sed "s|^audio:\(.*\)|audio:\1,lithium|" \
/etc/group >/tmp/pulse-group
if test `id -g` -ne 0; then if test `id -g` -ne 0; then
sed "s|^lithium:.*|lithium:x:`id -g`:|" /etc/group >/tmp/pulse-group echo "lithium:x:`id -g`:" >>/tmp/pulse-group
sed \
"s|^lithium:.*|lithium:x:`id -u`:`id -g`:lithium:/home/lithium:/bin/sh|" \
/etc/passwd >/tmp/pulse-passwd
else
cat /etc/group >/tmp/pulse-group
sed \
"s|^lithium:.*|lithium:x:`id -u`:0:lithium:/home/lithium:/bin/sh|" \
/etc/passwd >/tmp/pulse-passwd
fi fi
(
cat /etc/passwd
echo "lithium:x:`id -u`:`id -g`:lithium:/home/lithium:/bin/sh"
) >/tmp/pulse-passwd
fi fi
export NSS_WRAPPER_PASSWD=/tmp/pulse-passwd export NSS_WRAPPER_PASSWD=/tmp/pulse-passwd
export NSS_WRAPPER_GROUP=/tmp/pulse-group export NSS_WRAPPER_GROUP=/tmp/pulse-group
export LD_PRELOAD=/usr/lib/libnss_wrapper.so export LD_PRELOAD=/usr/lib/libnss_wrapper.so
fi fi
export HOME=/home/lithium
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment