From 48a24559a3c46efaa99ca6f3d43715e545381441 Mon Sep 17 00:00:00 2001 From: Amin Cheloh Date: Wed, 12 Oct 2016 16:47:56 +0700 Subject: [PATCH 1/2] Update entrypoint.sh Running application becomes container's PID 1 allow to receives Unix signals --- docker/entrypoint.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index bdde2caa4..34ab61148 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -8,7 +8,7 @@ case "$1" in if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then ARGS="$ARGS -peers=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT" fi - /usr/bin/weed $@ $ARGS + exec /usr/bin/weed $@ $ARGS ;; 'volume') @@ -17,7 +17,7 @@ case "$1" in if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then ARGS="$ARGS -mserver=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT" fi - /usr/bin/weed $@ $ARGS + exec /usr/bin/weed $@ $ARGS ;; 'server') @@ -25,10 +25,10 @@ case "$1" in if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then ARGS="$ARGS -master.peers=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT" fi - /usr/bin/weed $@ $ARGS + exec /usr/bin/weed $@ $ARGS ;; *) - /usr/bin/weed $@ + exec /usr/bin/weed $@ ;; -esac +esac From 54bd1c406a70fab3f71332511897460fed32e568 Mon Sep 17 00:00:00 2001 From: Amin Cheloh Date: Wed, 12 Oct 2016 17:10:38 +0700 Subject: [PATCH 2/2] Update Dockerfile Move COPY /entrypoint.sh to bottom and make sure entrypoint.sh have execute permission --- docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ed1c4dfe3..21e5a7b47 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,5 @@ FROM progrium/busybox -COPY entrypoint.sh /entrypoint.sh -COPY Dockerfile /etc/Dockerfile - RUN opkg-install curl RUN echo tlsv1 >> ~/.curlrc @@ -15,4 +12,7 @@ EXPOSE 9333 VOLUME /data +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + ENTRYPOINT ["/entrypoint.sh"]