-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·86 lines (73 loc) · 2.52 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
FROM alpine:3.12 AS builder
LABEL \
org.opencontainers.image.title="shadowsocks" \
org.opencontainers.image.authors="metowolf <[email protected]>, akafeng <[email protected]>" \
org.opencontainers.image.source="https://github.com/akafeng/docker-shadowsocks"
ARG SS_VERSION="3.3.5"
ARG SS_URL="https://github.com/shadowsocks/shadowsocks-libev/releases/download/v${SS_VERSION}/shadowsocks-libev-${SS_VERSION}.tar.gz"
ARG SIMPLE_OBFS_URL="https://github.com/shadowsocks/simple-obfs.git"
ARG V2RAY_PLUGIN_VERSION="1.3.1"
ARG V2RAY_PLUGIN_URL="https://github.com/shadowsocks/v2ray-plugin/releases/download/v${V2RAY_PLUGIN_VERSION}/v2ray-plugin-linux-amd64-v${V2RAY_PLUGIN_VERSION}.tar.gz"
RUN set -eux \
&& apk add --no-cache \
git \
autoconf \
automake \
build-base \
c-ares-dev \
libev-dev \
libtool \
libsodium-dev \
linux-headers \
mbedtls-dev \
pcre-dev \
\
&& wget -O shadowsocks-libev.tar.gz ${SS_URL} \
&& tar -xzvf shadowsocks-libev.tar.gz \
&& cd shadowsocks-libev* \
&& ./configure --prefix=/usr/local --disable-documentation \
&& make install \
\
&& cd .. \
&& git clone --depth=1 --recurse-submodules --shallow-submodules ${SIMPLE_OBFS_URL} simple-obfs \
&& cd simple-obfs \
&& ./autogen.sh \
&& ./configure --prefix=/usr/local --disable-documentation \
&& make install \
\
&& cd .. \
&& wget -O v2ray-plugin.tar.gz ${V2RAY_PLUGIN_URL} \
&& tar -xzvf v2ray-plugin.tar.gz \
&& mv v2ray-plugin_linux_amd64 /usr/local/bin/v2ray-plugin
######
FROM alpine:3.12
LABEL \
org.opencontainers.image.title="shadowsocks" \
org.opencontainers.image.authors="metowolf <[email protected]>, akafeng <[email protected]>" \
org.opencontainers.image.source="https://github.com/akafeng/docker-shadowsocks"
ENV SERVER_ADDR="0.0.0.0"
ENV SERVER_PORT="8388"
ENV PASSWORD=
ENV METHOD="aes-256-gcm"
ENV TIMEOUT="300"
ENV DNS="8.8.8.8,8.8.4.4"
ENV OBFS=
ENV PLUGIN=
ENV PLUGIN_OPTS=
COPY --from=builder /usr/local/bin/* /usr/local/bin/
RUN set -eux \
&& runDeps=$( \
scanelf --needed --nobanner /usr/local/bin/ss-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
) \
&& apk add --no-cache \
ca-certificates \
rng-tools \
tzdata \
$runDeps \
&& sed -i "s@#!/bin/bash@#!/bin/sh@g" /usr/local/bin/ss-nat
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE ${SERVER_PORT}/tcp
EXPOSE ${SERVER_PORT}/udp