This commit is contained in:
ficapy 2018-02-19 02:43:46 +00:00 committed by GitHub
commit 97fe7f2ef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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