Make the bigbluebutton user id be mapped on startup ( and no more during build time )

This commit is contained in:
Tiago Jacobs 2020-08-02 20:05:11 -03:00
parent edb4755cd7
commit 29ff2504ff
4 changed files with 4 additions and 18 deletions

View File

@ -35,7 +35,7 @@ if (($INSTANCE_NUMBER >= 1)); then
iptables -C $FORWARD_RULE || iptables -I $FORWARD_RULE
docker run --network bbb-libreoffice --name bbb-libreoffice-${INSTANCE_NUMBER} -p $PORT:8000 -v${SOFFICE_WORK_DIR}:${SOFFICE_WORK_DIR} --rm bbb-libreoffice &
docker run --network bbb-libreoffice --user `id -u bigbluebutton` --name bbb-libreoffice-${INSTANCE_NUMBER} -p $PORT:8000 -v${SOFFICE_WORK_DIR}:${SOFFICE_WORK_DIR} --rm bbb-libreoffice &
wait $!
else

View File

@ -4,26 +4,12 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt update
ARG user_id
RUN echo "User id = $user_id"
RUN addgroup --system --gid $user_id libreoffice
# We need to ensure that this user id is the same as the user bigbluebutton in the host
RUN adduser --disabled-password --system --disabled-login --shell /sbin/nologin --gid $user_id --uid $user_id libreoffice
RUN apt -y install locales-all fontconfig libxt6 libxrender1
RUN apt -y install libreoffice --no-install-recommends
RUN dpkg-reconfigure fontconfig && fc-cache -f -s -v
VOLUME ["/usr/share/fonts/"]
RUN chown libreoffice /home/libreoffice/
ADD ./bbb-libreoffice-entrypoint.sh /usr/local/bin/
ADD ./bbb-libreoffice-entrypoint.sh /home/libreoffice/
RUN chown -R libreoffice /home/libreoffice/
RUN chmod 700 /home/libreoffice/bbb-libreoffice-entrypoint.sh
USER libreoffice
ENTRYPOINT ["/home/libreoffice/bbb-libreoffice-entrypoint.sh" ]
ENTRYPOINT ["/usr/local/bin/bbb-libreoffice-entrypoint.sh" ]

0
bbb-libreoffice/docker/bbb-libreoffice-entrypoint.sh Normal file → Executable file
View File

View File

@ -25,7 +25,7 @@ fi
IMAGE_CHECK=`docker image inspect bbb-libreoffice &> /dev/null && echo 1 || echo 0`
if [ "$IMAGE_CHECK" = "0" ]; then
echo "Docker image doesn't exists, building"
docker build -t bbb-libreoffice --build-arg user_id=`id -u bigbluebutton` docker/
docker build -t bbb-libreoffice docker/
else
echo "Docker image already exists";
fi