2019-11-07 22:12:45 +09:00
|
|
|
# Dockerfile for v2ray based alpine
|
2020-01-20 21:40:05 +09:00
|
|
|
# Copyright (C) 2019 - 2020 Teddysun <i@teddysun.com>
|
2019-11-07 22:12:45 +09:00
|
|
|
# Reference URL:
|
|
|
|
# https://github.com/v2ray/v2ray-core
|
2019-11-29 21:59:52 +09:00
|
|
|
# https://github.com/v2ray/geoip
|
|
|
|
# https://github.com/v2ray/domain-list-community
|
2019-11-07 22:12:45 +09:00
|
|
|
|
|
|
|
FROM golang:alpine AS builder
|
|
|
|
RUN set -ex \
|
2019-11-21 21:05:05 +09:00
|
|
|
&& apk add --no-cache git unzip \
|
2019-11-07 22:12:45 +09:00
|
|
|
&& mkdir -p /go/src/github.com/v2ray \
|
|
|
|
&& cd /go/src/github.com/v2ray \
|
|
|
|
&& git clone https://github.com/v2ray/v2ray-core.git \
|
|
|
|
&& cd v2ray-core \
|
|
|
|
&& go get -d \
|
|
|
|
&& cd main \
|
|
|
|
&& go build -o /go/bin/v2ray \
|
|
|
|
&& cd ../infra/control/main \
|
2019-11-21 21:05:05 +09:00
|
|
|
&& go build -o /go/bin/v2ctl \
|
2020-01-20 21:40:05 +09:00
|
|
|
&& wget -O /go/bin/geosite.dat https://github.com/v2ray/domain-list-community/releases/latest/download/dlc.dat \
|
|
|
|
&& wget -O /go/bin/geoip.dat https://github.com/v2ray/geoip/releases/latest/download/geoip.dat
|
2019-11-07 22:12:45 +09:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
LABEL maintainer="Teddysun <i@teddysun.com>"
|
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
&& apk add --no-cache tzdata ca-certificates \
|
2019-11-08 21:01:05 +09:00
|
|
|
&& rm -rf /var/cache/apk/* \
|
2019-11-07 22:12:45 +09:00
|
|
|
&& mkdir -p /etc/v2ray \
|
|
|
|
&& mkdir -p /var/log/v2ray
|
|
|
|
|
|
|
|
COPY --from=builder /go/bin/v2ray /usr/bin
|
|
|
|
COPY --from=builder /go/bin/v2ctl /usr/bin
|
2019-11-21 21:05:05 +09:00
|
|
|
COPY --from=builder /go/bin/geoip.dat /usr/bin
|
|
|
|
COPY --from=builder /go/bin/geosite.dat /usr/bin
|
2019-11-07 22:12:45 +09:00
|
|
|
COPY config.json /etc/v2ray/config.json
|
|
|
|
VOLUME /etc/v2ray
|
|
|
|
|
|
|
|
ENV TZ=Asia/Shanghai
|
|
|
|
|
|
|
|
CMD [ "v2ray", "-config", "/etc/v2ray/config.json" ]
|