Skip to content

Instantly share code, notes, and snippets.

@moolex
Last active May 7, 2017 13:37
Show Gist options
  • Save moolex/6573501e6319dfcdf2624868d0eef2a0 to your computer and use it in GitHub Desktop.
Save moolex/6573501e6319dfcdf2624868d0eef2a0 to your computer and use it in GitHub Desktop.
shadowsocks-libev + simple-obfs
#
# Dockerfile for shadowsocks-libev
#
FROM alpine
MAINTAINER kev <noreply@datageek.info>
ARG OB_VER=0.0.3
ARG SS_VER=3.0.6
ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$SS_VER/shadowsocks-libev-$SS_VER.tar.gz
ENV SERVER_ADDR 0.0.0.0
ENV SERVER_PORT 8388
ENV PASSWORD=
ENV METHOD aes-256-cfb
ENV TIMEOUT 300
ENV DNS_ADDR 8.8.8.8
ENV DNS_ADDR_2 8.8.4.4
ENV OBFS_OPTS "obfs=http"
RUN set -ex && \
apk add --no-cache --virtual .build-deps \
autoconf \
automake \
build-base \
curl \
libev-dev \
libtool \
linux-headers \
udns-dev \
libsodium-dev \
mbedtls-dev \
pcre-dev \
tar \
git \
udns-dev && \
cd /tmp && \
curl -sSL $SS_URL | tar xz --strip 1 && \
./configure --prefix=/usr --disable-documentation && \
make install && \
cd .. && \
git clone https://github.com/shadowsocks/simple-obfs.git && \
cd simple-obfs && \
git checkout v$OB_VER && \
git submodule update --init --recursive && \
./autogen.sh && \
./configure --prefix=/usr --disable-documentation && \
make install && \
cd .. && \
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 $runDeps && \
apk del .build-deps && \
rm -rf /tmp/*
USER nobody
EXPOSE $SERVER_PORT/tcp $SERVER_PORT/udp
CMD ss-server -s $SERVER_ADDR \
-p $SERVER_PORT \
-k ${PASSWORD:-$(hostname)} \
-m $METHOD \
-t $TIMEOUT \
--fast-open \
--plugin obfs-server \
--plugin-opts $OBFS_OPTS \
-d $DNS_ADDR \
-d $DNS_ADDR_2 \
-u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment