-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (68 loc) · 1.87 KB
/
Dockerfile
File metadata and controls
74 lines (68 loc) · 1.87 KB
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
65
66
67
68
69
70
71
72
73
74
FROM alpine
LABEL maintainer="lostsnow <lostsnow@gmail.com>"
ARG SS_VER=3.3.1
ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$SS_VER/shadowsocks-libev-$SS_VER.tar.gz
ENV SERVER_ADDR 0.0.0.0
ENV SERVER_PORT 8088
ENV PASSWORD=
ENV METHOD aes-256-gcm
ENV TIMEOUT 300
ENV DNS_ADDRS 8.8.8.8,8.8.4.4
ENV ARGS=
RUN set -ex && \
apk add --no-cache --virtual .build-deps \
autoconf \
automake \
build-base \
c-ares-dev \
curl \
libev-dev \
libtool \
libsodium-dev \
linux-headers \
mbedtls-dev \
pcre-dev \
tar \
git && \
# Build & install
cd /tmp && \
curl -sSL $SS_URL | tar xz --strip 1 && \
./configure --prefix=/usr --disable-documentation && \
make install && \
cd .. && \
# Runtime dependencies setup
apk add --no-cache \
ca-certificates \
rng-tools \
$(scanelf --needed --nobanner /usr/bin/ss-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u) && \
rm -rf /tmp/* && \
cd /tmp/ && \
git clone https://github.com/shadowsocks/simple-obfs.git && \
cd simple-obfs && \
git submodule update --init --recursive && \
./autogen.sh && \
./configure --prefix=/usr --disable-documentation && \
make && \
make install && \
cd .. && \
# Runtime dependencies setup
apk add --no-cache \
rng-tools \
$(scanelf --needed --nobanner /usr/bin/obfs-server \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u) && \
apk del .build-deps && \
rm -rf /tmp/*
USER nobody
EXPOSE $SERVER_PORT/tcp $SERVER_PORT/udp
CMD ss-server -s $SERVER_ADDR \
-p $SERVER_PORT \
-k ${PASSWORD:-$(hostname)} \
-m $METHOD \
-t $TIMEOUT \
--fast-open \
-d $DNS_ADDRS \
-u \
$ARGS