-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
64 lines (57 loc) · 1.48 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# Dockerfile for shadowsocks-libev (ss-local)
#
FROM alpine
ARG LIBEV_VERSION=v3.3.4
ENV SERVER_ADDR 0.0.0.0
ENV SERVER_PORT 8388
ENV PASSWORD=
ENV METHOD aes-256-gcm
ENV TIMEOUT 300
ENV LISTEN_ADDR 127.0.0.1
ENV LISTEN_PORT 1080
ENV ARGS=
RUN set -ex \
# Build environment setup
&& apk add --no-cache --virtual .build-deps \
autoconf \
automake \
build-base \
c-ares-dev \
libev-dev \
libtool \
libsodium-dev \
linux-headers \
mbedtls-dev \
pcre-dev \
git \
# Build & install
&& mkdir -p /tmp/repo \
&& cd /tmp/repo \
&& git clone https://github.com/shadowsocks/shadowsocks-libev.git \
&& cd shadowsocks-libev \
&& git checkout "$LIBEV_VERSION" \
&& git submodule update --init --recursive \
&& ./autogen.sh \
&& ./configure --prefix=/usr --disable-documentation \
&& make install \
&& apk del .build-deps \
# Runtime dependencies setup
&& apk add --no-cache \
ca-certificates \
rng-tools \
tzdata \
$(scanelf --needed --nobanner /usr/bin/ss-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u) \
&& rm -rf /tmp/repo
EXPOSE $LISTEN_PORT
ENTRYPOINT ss-local -s "$SERVER_ADDR" \
-p "$SERVER_PORT" \
-k "$PASSWORD" \
-m "$METHOD" \
-d "$DNS_ADDRS" \
-b "$LISTEN_ADDR" \
-l "$LISTEN_PORT" \
-t "$TIMEOUT" \
"$ARGS"