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.

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