# Dockerfile for shadowsocks-libev based alpine # Copyright (C) 2018 - 2019 Teddysun # Reference URL: # https://github.com/shadowsocks/shadowsocks-libev FROM alpine:latest LABEL maintainer="Teddysun " ENV LIBEV_VER 3.2.5 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 runDeps="\ tar \ git \ wget \ build-base \ c-ares-dev \ autoconf \ automake \ libev-dev \ libtool \ libsodium-dev \ linux-headers \ mbedtls-dev \ pcre-dev \ "; \ set -ex \ && 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" ]