-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
94 lines (83 loc) · 2.25 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM alpine:3.8
LABEL MAINTAINER="guigui"
ARG SS_VER=3.2.0
ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_VER}/shadowsocks-libev-${SS_VER}.tar.gz
ARG KCP_VER=20180316
ARG KCP_URL=https://github.com/xtaci/kcptun/releases/download/v${KCP_VER}/kcptun-linux-amd64-${KCP_VER}.tar.gz
ENV ROOT_PASSWORD=guigui
ENV TIMEZONE=Asia/Shanghai
RUN echo "${TIMEZONE}" > /etc/timezone && \
ln -sf /usr/share/zoneinfo/${TIMEZONE}} /etc/localtime && \
apk --no-cache upgrade && \
apk --no-cache --virtual .build-deps add \
openssh-server \
autoconf \
build-base \
curl \
libev-dev \
linux-headers \
libsodium-dev \
mbedtls-dev \
pcre-dev \
tar \
tzdata \
c-ares-dev \
git \
gcc \
make \
libtool \
zlib-dev \
automake \
openssl \
asciidoc \
xmlto \
libpcre32 \
g++ && \
cd /tmp
# 部署ssh服务器
RUN ssh-keygen -A
# 部署shadowsocks服务器
ENV SS_PORT=8989
ENV SS_PASSWORD=507811210
ENV SS_METHOD=aes-256-cfb
ENV SS_TIMEOUT=300
ENV SS_FASTOPEN=--fast-open
ENV SS_UDP_RELAY=-u
ENV SS_DNS=8.8.8.8
ENV SS_DNS2=8.8.4.4
ENV SS_ARGS=''
RUN mkdir shadowsocks-libev && \
cd shadowsocks-libev && \
curl -sSL ${SS_URL} | tar xz --strip 1 && \
./configure --prefix=/usr --disable-documentation && \
make install && \
cd .. && \
git clone https://github.com/shadowsocks/simple-obfs.git && \
cd simple-obfs && \
git submodule update --init --recursive && \
./autogen.sh && \
./configure && \
make && \
make install && \
cd ..
# 部署kcptun服务器
ENV KCP_PORT=8990
ENV KCP_PASSWORD=guigui
ENV KCP_ENCRYPT=aes-192
ENV KCP_MODE=fast2
ENV KCP_MUT=1350
ENV KCP_NOCOMP=''
ENV KCP_ARGS=''
RUN curl -sSL ${KCP_URL} | tar xz server_linux_amd64 && \
mv server_linux_amd64 /usr/bin/
# 清理环境
RUN cd .. && \
rm -rf /var/cache/apk/* /tmp/*
# 开放端口
EXPOSE 22
EXPOSE ${SS_PORT}/tcp
EXPOSE ${SS_PORT}/udp
EXPOSE ${KCP_PORT}/udp
# 启动命令
ADD entrypoint.sh /usr/bin/entrypoint.sh
ENTRYPOINT [ "bash", "/usr/bin/entrypoint.sh" ]