# # Dockerfile for shadowsocks-libev # FROM alpine LABEL maintainer="Kaugrazaka Shira " ENV BIND_ADDR 0.0.0.0 ENV BIND_PORT 8981 ENV PASSWORD 123456 ENV METHOD aes-256-cfb ENV TIMEOUT 300 ENV DNS_1 8.8.8.8 ENV DNS_2 8.8.4.4 ENV ARGS= ENV OBFS tls ENV SS_DIR /tmp/shadowsocks-libev ENV OBFS_DIR /tmp/simple-obfs RUN set -ex && \ apk add --no-cache --virtual .build-deps \ git \ autoconf \ automake \ libtool \ build-base \ libev-dev \ linux-headers \ libsodium-dev \ mbedtls-dev \ pcre-dev \ c-ares-dev \ gcc \ make \ zlib-devel \ openssl \ asciidoc \ xmlto \ libpcre32 \ g++ && \ git clone https://github.com/shadowsocks/shadowsocks-libev $SS_DIR && \ cd $SS_DIR && \ ./autogen.sh && \ ./configure --prefix=/usr --disable-documentation && \ make install && \ runDeps="$( \ scanelf --needed --nobanner /usr/bin/ss-* \ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ | xargs -r apk info --installed \ | sort -u \ )" && \ apk add --no-cache --virtual .run-deps \ rng-tools \ $runDeps && \ git clone https://github.com/shadowsocks/simple-obfs $OBFS_DIR && \ cd $OBFS_DIR && \ git submodule update --init --recursive && \ ./autogen.sh && \ ./configure && make && \ make install && \ apk del .build-deps && \ rm -rf $SS_DIR/* $OBFS_DIR/* USER nobody EXPOSE 8388/tcp 8388/udp CMD ss-server -s $BIND_ADDR \ -p $BIND_PORT \ -k $PASSWORD \ -m $METHOD \ -t $TIMEOUT \ -d $DNS_1 \ -d $DNS_2 \ -u \ --plugin obfs-server \ --plugin-opts "obfs=$OBFS" \ $ARGS