You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

7 years ago
  1. #
  2. # Dockerfile for shadowsocks-libev
  3. #
  4. FROM alpine
  5. MAINTAINER kev <noreply@datageek.info>
  6. ARG SS_VER=2.6.2
  7. ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/archive/v$SS_VER.tar.gz
  8. ENV SERVER_ADDR 0.0.0.0
  9. ENV SERVER_PORT 8388
  10. ENV PASSWORD=
  11. ENV METHOD aes-256-cfb
  12. ENV TIMEOUT 300
  13. ENV DNS_ADDR 8.8.8.8
  14. ENV DNS_ADDR_2 8.8.4.4
  15. RUN set -ex && \
  16. apk add --no-cache --virtual .build-deps \
  17. asciidoc \
  18. autoconf \
  19. build-base \
  20. curl \
  21. libtool \
  22. linux-headers \
  23. openssl-dev \
  24. pcre-dev \
  25. tar \
  26. xmlto && \
  27. cd /tmp && \
  28. curl -sSL $SS_URL | tar xz --strip 1 && \
  29. ./configure --prefix=/usr --disable-documentation && \
  30. make install && \
  31. cd .. && \
  32. runDeps="$( \
  33. scanelf --needed --nobanner /usr/bin/ss-* \
  34. | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
  35. | xargs -r apk info --installed \
  36. | sort -u \
  37. )" && \
  38. apk add --no-cache --virtual .run-deps $runDeps && \
  39. apk del .build-deps && \
  40. rm -rf /tmp/*
  41. USER nobody
  42. EXPOSE $SERVER_PORT/tcp $SERVER_PORT/udp
  43. CMD ss-server -s $SERVER_ADDR \
  44. -p $SERVER_PORT \
  45. -k ${PASSWORD:-$(hostname)} \
  46. -m $METHOD \
  47. -t $TIMEOUT \
  48. --fast-open \
  49. -d $DNS_ADDR \
  50. -d $DNS_ADDR_2 \
  51. -u