forked from beermedlar/clash-transparent-proxy-docker
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
34 lines (28 loc) · 944 Bytes
/
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
# build clash
FROM golang:alpine as builder
RUN apk add --no-cache make git && \
wget -O /Country.mmdb https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb && \
git clone https://github.com/Dreamacro/clash.git /clash-src
WORKDIR /clash-src
RUN git checkout v1.6.5 && \
go mod download
COPY Makefile /clash-src/Makefile
RUN make current
FROM alpine:latest
ENV TZ=Asia/Shanghai
# RUN echo "https://mirror.tuna.tsinghua.edu.cn/alpine/v3.11/main/" > /etc/apk/repositories
COPY --from=builder /clash-src/bin/clash /usr/local/bin/
COPY --from=builder /Country.mmdb /root/.config/clash/
COPY entrypoint.sh /usr/local/bin/
COPY config.yaml /root/.config/clash/
RUN apk add --no-cache \
ca-certificates \
bash \
curl \
iptables \
bash-doc \
bash-completion \
rm -rf /var/cache/apk/* && \
chmod a+x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
CMD ["clash"]