From debfeb177c05b2f7398cafccd787ea524e41a2d9 Mon Sep 17 00:00:00 2001 From: ficapy Date: Wed, 24 Aug 2016 00:45:45 +0800 Subject: [PATCH] dockerfile use alpine --- Dockerfile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 510d422..7eea760 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,19 @@ -FROM ubuntu:14.04 +FROM alpine:3.4 -RUN apt-get update && apt-get install -y \ - python-software-properties \ - software-properties-common \ - && add-apt-repository ppa:chris-lea/libsodium \ - && echo "deb http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list \ - && echo "deb-src http://ppa.launchpad.net/chris-lea/libsodium/ubuntu trusty main" >> /etc/apt/sources.list \ - && apt-get update \ - && apt-get install -y libsodium-dev python-pip +RUN if [ $(wget -qO- ipinfo.io/country) == CN ]; then echo "http://mirrors.ustc.edu.cn/alpine/v3.4/main/" > /etc/apk/repositories ;fi \ + && apk update && apk upgrade \ + && apk add python py-pip libsodium -RUN pip install shadowsocks - -ENTRYPOINT ["/usr/local/bin/ssserver"] +COPY . /shadowsocks +WORKDIR /shadowsocks +RUN python setup.py install +ENTRYPOINT ["/usr/bin/ssserver"] # usage: -# docker run -d --restart=always -p 1314:1314 ficapy/shadowsocks -s 0.0.0.0 -p 1314 -k $PD -m chacha20 +# docker build -t shadowsocks . +# server: +# docker run -d --restart=always -p 1314:1314 -v /etc/shadowsocks.json:/config shadowsocks -s 0.0.0.0 -c /config +# or docker run -d --restart=always -p 1314 +# client: +# docker run -d --entrypoint=/usr/bin/sslocal --restart=always -p 1080:1080 -v /etc/shadowsocks.json:/config shadowsocks -c /config +