Skip to content

Instantly share code, notes, and snippets.

@Liminiens
Forked from longkai/Dockerfile
Last active April 17, 2018 20:34
Show Gist options
  • Save Liminiens/5372c5c0d93ae916ec67f354cf8d1af0 to your computer and use it in GitHub Desktop.
Save Liminiens/5372c5c0d93ae916ec67f354cf8d1af0 to your computer and use it in GitHub Desktop.
shadowsocks-libev with simple obfs in a single docker image
#
# Dockerfile for shadowsocks-libev
#
FROM alpine
MAINTAINER longkai <i@xiaolongtongxue.com>
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
RUN set -ex && \
apk add --no-cache --virtual .build-deps \
autoconf \
build-base \
libev-dev \
libtool \
linux-headers \
udns-dev \
c-ares-dev \
libsodium-dev \
mbedtls-dev \
pcre-dev \
tar \
git \
automake \
zlib-devel \
openssl \
asciidoc \
xmlto \
libpcre32 \
g++ \
gcc \
udns-dev && \
cd /tmp && \
git clone --depth=1 https://github.com/shadowsocks/simple-obfs.git . && \
git submodule update --init --recursive && \
./autogen.sh && \
./configure --prefix=/usr --disable-documentation && make && \
make install && \
cd .. && \
find /tmp -mindepth 1 -delete && \
cd /tmp && \
git clone --depth=1 https://github.com/shadowsocks/shadowsocks-libev.git . && \
git submodule update --init --recursive && \
./autogen.sh && \
./configure --prefix=/usr --disable-documentation && make && \
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 \
-d $DNS_ADDR \
-d $DNS_ADDR_2 \
-u \
--plugin obfs-server --plugin-opts "obfs=http"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment