From a9a7d434ca2023898e9be0cce2aca56fcfd5a369 Mon Sep 17 00:00:00 2001 From: Sah Date: Fri, 9 Feb 2018 19:29:46 +0100 Subject: [PATCH] Optimize Dockerfile * Install rng-tools as runtime dependency * Remove unnecessary 'git submodule update', as Docker Cloud runs 'git submodule update' after cloning the repository * Replace variable SERVER_PORT with fixed port 8388, as it can't be customized with -e anyway --- docker/alpine/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile index 91abbdc3..5e17fb71 100644 --- a/docker/alpine/Dockerfile +++ b/docker/alpine/Dockerfile @@ -6,7 +6,6 @@ FROM alpine MAINTAINER kev ENV SERVER_ADDR 0.0.0.0 -ENV SERVER_PORT 8388 ENV PASSWORD= ENV METHOD aes-256-cfb ENV TIMEOUT 300 @@ -30,7 +29,6 @@ RUN set -ex && \ pcre-dev \ c-ares-dev && \ cd /tmp && \ - git submodule update --init --recursive && \ ./autogen.sh && \ ./configure --prefix=/usr --disable-documentation && \ make install && \ @@ -41,16 +39,18 @@ RUN set -ex && \ | xargs -r apk info --installed \ | sort -u \ )" && \ - apk add --no-cache --virtual .run-deps $runDeps && \ + apk add --no-cache --virtual .run-deps \ + rng-tools \ + $runDeps && \ apk del .build-deps && \ rm -rf /tmp/* USER nobody -EXPOSE $SERVER_PORT/tcp $SERVER_PORT/udp +EXPOSE 8388/tcp 8388/udp CMD ss-server -s $SERVER_ADDR \ - -p $SERVER_PORT \ + -p 8388 \ -k ${PASSWORD:-$(hostname)} \ -m $METHOD \ -t $TIMEOUT \