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.

57 lines
1.2 KiB

  1. #
  2. # Dockerfile for shadowsocks-libev
  3. #
  4. FROM alpine
  5. LABEL maintainer="kev <noreply@datageek.info>, Sah <contact@leesah.name>"
  6. ENV SERVER_ADDR 0.0.0.0
  7. ENV SERVER_ADDR_IPV6 ::0
  8. ENV SERVER_PORT 8388
  9. ENV PASSWORD=
  10. ENV METHOD aes-256-gcm
  11. ENV TIMEOUT 300
  12. ENV DNS_ADDRS 8.8.8.8,8.8.4.4
  13. ENV ARGS=
  14. COPY . /tmp/repo
  15. RUN set -ex \
  16. # Build environment setup
  17. && apk add --no-cache --virtual .build-deps \
  18. autoconf \
  19. automake \
  20. build-base \
  21. c-ares-dev \
  22. libev-dev \
  23. libtool \
  24. libsodium-dev \
  25. linux-headers \
  26. mbedtls-dev \
  27. pcre-dev \
  28. # Build & install
  29. && cd /tmp/repo \
  30. && ./autogen.sh \
  31. && ./configure --prefix=/usr --disable-documentation \
  32. && make install \
  33. && apk del .build-deps \
  34. # Runtime dependencies setup
  35. && apk add --no-cache \
  36. rng-tools \
  37. $(scanelf --needed --nobanner /usr/bin/ss-* \
  38. | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
  39. | sort -u) \
  40. && rm -rf /tmp/repo
  41. USER nobody
  42. CMD exec ss-server \
  43. -s $SERVER_ADDR \
  44. -s $SERVER_ADDR_IPV6 \
  45. -p $SERVER_PORT \
  46. -k ${PASSWORD:-$(hostname)} \
  47. -m $METHOD \
  48. -t $TIMEOUT \
  49. --fast-open \
  50. -d $DNS_ADDRS \
  51. -u \
  52. $ARGS