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.

55 lines
1.3 KiB

  1. FROM alpine:3.16
  2. LABEL maintainer="kev <noreply@datageek.info>, Sah <contact@leesah.name>, vndroid <waveworkshop@outlook.com>"
  3. ENV SERVER_ADDR=0.0.0.0
  4. ENV SERVER_PORT=8388
  5. ENV PASSWORD=
  6. ENV METHOD=aes-256-gcm
  7. ENV TIMEOUT=300
  8. ENV DNS_ADDRS="8.8.8.8,8.8.4.4"
  9. ENV TZ=UTC
  10. ENV ARGS=
  11. COPY . /tmp/repo
  12. RUN set -x \
  13. # Build environment setup
  14. && apk add --no-cache --virtual .build-deps \
  15. autoconf \
  16. automake \
  17. build-base \
  18. c-ares-dev \
  19. libcap \
  20. libev-dev \
  21. libtool \
  22. libsodium-dev \
  23. linux-headers \
  24. mbedtls-dev \
  25. pcre-dev \
  26. # Build & install
  27. && cd /tmp/repo \
  28. && ./autogen.sh \
  29. && ./configure --prefix=/usr/local --disable-documentation \
  30. && make -j$(getconf _NPROCESSORS_ONLN) \
  31. && make install \
  32. && cd /usr/local/bin \
  33. && ls /usr/local/bin/ss-* | xargs -n1 setcap cap_net_bind_service+ep \
  34. && strip $(ls /usr/local/bin | grep -Ev 'ss-nat') \
  35. && apk del .build-deps \
  36. # Runtime dependencies setup
  37. && apk add --no-cache \
  38. ca-certificates \
  39. rng-tools \
  40. tzdata \
  41. $(scanelf --needed --nobanner /usr/local/bin/ss-* \
  42. | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
  43. | sort -u) \
  44. && rm -rf /tmp/repo
  45. COPY ./docker/alpine/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
  46. ENTRYPOINT ["docker-entrypoint.sh"]
  47. EXPOSE 8388
  48. STOPSIGNAL SIGINT
  49. CMD ["ss-server"]