From e48c2d1bb78522eb4fd86ac805693b1933c4e355 Mon Sep 17 00:00:00 2001 From: Freax Date: Tue, 24 Sep 2019 00:15:26 +0800 Subject: [PATCH 1/2] Minimize the number of layers --- Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index db4517c..0953068 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,8 @@ ARG ISSO_VER=0.12.2 ENV GID=1000 UID=1000 +COPY run.sh /usr/local/bin/run.sh + RUN apk -U upgrade \ && apk add -t build-dependencies \ python3-dev \ @@ -18,16 +20,13 @@ RUN apk -U upgrade \ tini \ && pip3 install --no-cache "isso==${ISSO_VER}" \ && apk del build-dependencies \ + && chmod +x /usr/local/bin/run.sh \ && rm -rf /tmp/* /var/cache/apk/* -COPY run.sh /usr/local/bin/run.sh - -RUN chmod +x /usr/local/bin/run.sh - EXPOSE 8080 VOLUME /db /config LABEL maintainer="Wonderfall " -CMD ["run.sh"] +CMD ["run.sh"] \ No newline at end of file From 602077470cb1c76df887c6d25f8645597e144674 Mon Sep 17 00:00:00 2001 From: Freax Date: Tue, 24 Sep 2019 00:17:28 +0800 Subject: [PATCH 2/2] Check if the configuration file exists --- run.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 7b6416a..c06a36e 100644 --- a/run.sh +++ b/run.sh @@ -1,3 +1,9 @@ #!/bin/sh chown -R $UID:$GID /db /config -exec su-exec $UID:$GID /sbin/tini -- isso -c /config/isso.conf run +CONFIGFILE=/config/isso.conf +if test -f "$CONFIGFILE"; then + exec su-exec $UID:$GID /sbin/tini -- isso -c $CONFIGFILE run +else + echo "The configuration file $CONFIGFILE was not found." + exit +fi