-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (54 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
62 lines (54 loc) · 1.45 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
FROM golang:alpine as build
RUN apk add --no-cache ca-certificates git
WORKDIR /build
RUN set -ex \
&& git clone https://github.com/shadowsocks/v2ray-plugin \
&& cd v2ray-plugin \
&& CGO_ENABLED=0 go build -a -v -ldflags "-s -w"
#
# Dockerfile for shadowsocks-libev
#
FROM alpine
LABEL maintainer="kev <noreply@datageek.info>, Sah <contact@leesah.name>"
LABEL maintainer="mq83"
ENV TZ UTC
COPY --from=build /build/v2ray-plugin/v2ray-plugin /usr/bin/v2ray-plugin
#COPY . /tmp/repo
WORKDIR /tmp/repo
RUN set -ex \
# Build environment setup
&& apk add --no-cache --virtual .build-deps \
autoconf \
automake \
build-base \
c-ares-dev \
libcap \
libev-dev \
libtool \
libsodium-dev \
linux-headers \
mbedtls-dev \
pcre-dev \
git \
# Build & install
&& git clone --recursive https://github.com/shadowsocks/shadowsocks-libev.git \
# && cd /tmp/repo \
&& cd shadowsocks-libev \
&& ./autogen.sh \
&& ./configure --prefix=/usr --disable-documentation \
&& make -j8 \
&& make install \
&& ls /usr/bin/ss-* | xargs -n1 setcap cap_net_bind_service+ep \
&& apk del .build-deps \
# Runtime dependencies setup
&& apk add --no-cache \
ca-certificates \
rng-tools \
tini \
tzdata \
$(scanelf --needed --nobanner /usr/bin/ss-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u) \
&& rm -rf /tmp/repo
USER nobody
ENTRYPOINT ["/sbin/tini", "--"]