Skip to content

Commit

Permalink
Added shadowsocks-libev docker image based alpine
Browse files Browse the repository at this point in the history
Signed-off-by: Teddysun <[email protected]>
  • Loading branch information
teddysun committed Jul 4, 2018
1 parent 7e7e9df commit e61670f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
59 changes: 59 additions & 0 deletions docker/shadowsocks-libev/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Dockerfile for shadowsocks-libev based alpine
# Copyright (C) 2018 Teddysun <[email protected]>
# Reference URL:
# https://github.com/shadowsocks/shadowsocks-libev

FROM alpine:latest
LABEL maintainer="Teddysun <[email protected]>"

ENV LIBEV_VER 3.2.0
ENV LIBEV_NAME shadowsocks-libev-${LIBEV_VER}
ENV LIBEV_RELEASE https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${LIBEV_VER}/${LIBEV_NAME}.tar.gz

RUN set -ex \
&& runDeps=' \
tar \
git \
wget \
build-base \
c-ares-dev \
autoconf \
automake \
libev-dev \
libtool \
libsodium-dev \
linux-headers \
mbedtls-dev \
pcre-dev \
' \
&& apk add --no-cache --virtual .build-deps \
${runDeps} \
&& mkdir -p /tmp/libev \
&& cd /tmp/libev \
&& git clone --depth=1 https://github.com/shadowsocks/simple-obfs.git . \
&& git submodule update --init --recursive \
&& ./autogen.sh \
&& ./configure --prefix=/usr --disable-documentation \
&& make install \
&& rm -rf * \
&& wget -qO ${LIBEV_NAME}.tar.gz ${LIBEV_RELEASE} \
&& tar zxf ${LIBEV_NAME}.tar.gz \
&& cd ${LIBEV_NAME} \
&& ./configure --prefix=/usr --disable-documentation \
&& make install \
&& apk add --no-cache \
rng-tools \
$(scanelf --needed --nobanner /usr/bin/ss-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| xargs -r apk info --installed \
| sort -u) \
&& apk del .build-deps \
&& cd /tmp \
&& rm -rf /tmp/libev \

COPY ./config_sample.json /etc/shadowsocks-libev/config.json
VOLUME /etc/shadowsocks-libev

USER nobody

CMD [ "ss-server", "-c", "/etc/shadowsocks-libev/config.json" ]
10 changes: 10 additions & 0 deletions docker/shadowsocks-libev/alpine/config_sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"server":"0.0.0.0",
"server_port":9000,
"password":"password0",
"timeout":300,
"method":"aes-256-gcm",
"fast_open":true,
"nameserver":"8.8.8.8",
"mode":"tcp_and_udp"
}

0 comments on commit e61670f

Please sign in to comment.