summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-12 18:26:30 +0200
committerlouiz’ <louiz@louiz.org>2017-04-12 18:26:30 +0200
commit7d2b8eb5268fe5b85f004eced289b7d61224e3c7 (patch)
tree103213b0be187562b64c3fd878950d1be55665e5
parentdec3e42ae32e61df4de8d58b3cea0f48b4c5d3d8 (diff)
downloadbiboumi-7d2b8eb5268fe5b85f004eced289b7d61224e3c7.tar.gz
biboumi-7d2b8eb5268fe5b85f004eced289b7d61224e3c7.tar.bz2
biboumi-7d2b8eb5268fe5b85f004eced289b7d61224e3c7.tar.xz
biboumi-7d2b8eb5268fe5b85f004eced289b7d61224e3c7.zip
Always chown biboumi /var/lib/biboumi when the docker container starts
This fixes permission problems when we bind a volume that is not owned by the biboumi user.
-rw-r--r--docker/biboumi/Dockerfile3
-rw-r--r--docker/biboumi/entrypoint.sh4
2 files changed, 3 insertions, 4 deletions
diff --git a/docker/biboumi/Dockerfile b/docker/biboumi/Dockerfile
index 721d106..7c8d78d 100644
--- a/docker/biboumi/Dockerfile
+++ b/docker/biboumi/Dockerfile
@@ -35,7 +35,6 @@ RUN git clone git://git.louiz.org/biboumi && mkdir ./biboumi/build && cd ./bibou
RUN useradd biboumi
RUN mkdir /var/lib/biboumi
-RUN chown -R biboumi:biboumi /var/lib/biboumi
COPY ./biboumi.cfg /etc/biboumi/biboumi.cfg
RUN chown -R biboumi:biboumi /etc/biboumi
@@ -44,5 +43,3 @@ COPY ./entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
-
-USER biboumi
diff --git a/docker/biboumi/entrypoint.sh b/docker/biboumi/entrypoint.sh
index eda53a4..8b9b869 100644
--- a/docker/biboumi/entrypoint.sh
+++ b/docker/biboumi/entrypoint.sh
@@ -5,7 +5,9 @@ sed -i s/BIBOUMI_HOSTNAME/${BIBOUMI_HOSTNAME:-biboumi.localhost}/ /etc/biboumi/b
sed -i s/BIBOUMI_ADMIN/${BIBOUMI_ADMIN:-}/ /etc/biboumi/biboumi.cfg
sed -i s/BIBOUMI_PASSWORD/${BIBOUMI_PASSWORD:-missing_password}/ /etc/biboumi/biboumi.cfg
+chown -R biboumi:biboumi /var/lib/biboumi
+
echo "Running biboumi with the following conf: "
cat /etc/biboumi/biboumi.cfg
-/usr/bin/biboumi /etc/biboumi/biboumi.cfg
+runuser -u biboumi /usr/bin/biboumi /etc/biboumi/biboumi.cfg