From 5501553cb518f3337d3077ed98707a071d9b39e2 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Thu, 18 Apr 2019 18:02:53 +0200 Subject: [PATCH] Reduce layers, revert back to not named entrypoints --- Dockerfile.cron | 29 ++++++++++++++++------------- Dockerfile.supervisord | 29 ++++++++++++++--------------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/Dockerfile.cron b/Dockerfile.cron index cb4433c..6371a76 100644 --- a/Dockerfile.cron +++ b/Dockerfile.cron @@ -18,15 +18,18 @@ FROM debian:jessie-slim # Prevent the packages installation to halt. ENV DEBIAN_FRONTEND noninteractive +# Create the seafile client user. +ENV UNAME=seafuser +ENV UID=1000 +ENV GID=1000 # Copy over the Docker related files. -COPY utils/build/import-seafile-apt-key.sh assets/docker-entrypoint.sh / - -# Copy over the required files for Seafile/SupervisorD. -COPY assets/infinite-seaf-cli-start.sh assets/seafile-entrypoint.sh /home/seafuser/ +COPY utils/build/import-seafile-apt-key.sh / +COPY assets/docker-entrypoint.sh /entrypoint.sh # Safely import Seafile APT key, then install both seafile-cli and supervisord. -RUN echo "deb http://deb.seadrive.org jessie main" \ > /etc/apt/source.list.d/seafile.list ;\ +RUN echo "deb http://deb.seadrive.org jessie main" \ + > /etc/apt/source.list.d/seafile.list ;\ bash /import-seafile-apt-key.sh ;\ apt-get update ;\ apt-get install \ @@ -45,13 +48,13 @@ RUN echo "deb http://deb.seadrive.org jessie main" \ > /etc/apt/source.list.d/se /import-seafile-apt-key.sh ;\ mkdir /volume/ ;\ echo "seafuser" > /etc/cron.allow ;\ - echo "*/20 * * * * /bin/bash /home/seafuser/infinite-seaf-cli-start.sh" > /var/spool/cron/crontabs/seafuser - -# Create the seafile client user. -ENV UNAME=seafuser -ENV UID=1000 -ENV GID=1000 -RUN groupadd -g $GID -o $UNAME ;\ + echo "*/20 * * * * /bin/bash /home/seafuser/infinite-seaf-cli-start.sh" \ + > /var/spool/cron/crontabs/seafuser \; + groupadd -g $GID -o $UNAME ;\ useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME -ENTRYPOINT ["/bin/bash", "/docker-entrypoint.sh"] +# Copy over the required files for Seafile/SupervisorD. +COPY assets/infinite-seaf-cli-start.sh /home/seafuser/ +COPY assets/seafile-entrypoint.sh /home/seafuser/entrypoint.sh + +ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] diff --git a/Dockerfile.supervisord b/Dockerfile.supervisord index 1f4254d..0075026 100644 --- a/Dockerfile.supervisord +++ b/Dockerfile.supervisord @@ -18,10 +18,18 @@ FROM debian:jessie-slim # Prevent the packages installation to halt. ENV DEBIAN_FRONTEND noninteractive +# Specify the user running Seafile. +ENV UNAME=seafuser +ENV UID=1000 +ENV GID=1000 + +# Copy over the Docker related files. +COPY utils/build/import-seafile-apt-key.sh / +COPY assets/docker-entrypoint.sh /entrypoint.sh # Safely import Seafile APT key, then install both seafile-cli and supervisord. -COPY utils/build/import-seafile-apt-key.sh / -RUN echo "deb http://deb.seadrive.org jessie main" > /etc/apt/source.list.d/seafile.list ;\ +RUN echo "deb http://deb.seadrive.org jessie main" \ + > /etc/apt/source.list.d/seafile.list ;\ /bin/bash /import-seafile-apt-key.sh ;\ apt-get update ;\ apt-get install \ @@ -37,22 +45,13 @@ RUN echo "deb http://deb.seadrive.org jessie main" > /etc/apt/source.list.d/seaf /var/log/fsck/*.log \ /var/log/apt/*.log \ /var/cache/debconf/*.dat-old \ - /import-seafile-apt-key.sh - -# Create the seafile client user. -ENV UNAME=seafuser -ENV UID=1000 -ENV GID=1000 -RUN groupadd -g $GID -o $UNAME ;\ + /import-seafile-apt-key.sh ;\ + mkdir /volume ;\ + groupadd -g $GID -o $UNAME ;\ useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME -# Copy over the Docker entrypoint. -COPY assets/docker-entrypoint.sh /entrypoint.sh - # Copy over the required files for Seafile/SupervisorD. -COPY assets/supervisord.conf /home/seafuser/ -COPY assets/infinite-seaf-cli-start.sh /home/seafuser/ +COPY assets/supervisord.conf assets/infinite-seaf-cli-start.sh /home/seafuser/ COPY assets/seafile-entrypoint.sh /home/seafuser/entrypoint.sh -RUN mkdir /volume ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]