mirror of
https://github.com/teddysun/across.git
synced 2025-01-31 12:19:35 +08:00
Update Dockerfile
This commit is contained in:
parent
d4685db5d3
commit
a7eaedee40
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
FROM golang:alpine AS builder
|
FROM golang:alpine AS builder
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk add --no-cache git \
|
&& apk add --no-cache git unzip \
|
||||||
&& mkdir -p /go/src/github.com/v2ray \
|
&& mkdir -p /go/src/github.com/v2ray \
|
||||||
&& cd /go/src/github.com/v2ray \
|
&& cd /go/src/github.com/v2ray \
|
||||||
&& git clone https://github.com/v2ray/v2ray-core.git \
|
&& git clone https://github.com/v2ray/v2ray-core.git \
|
||||||
@ -14,7 +14,20 @@ RUN set -ex \
|
|||||||
&& cd main \
|
&& cd main \
|
||||||
&& go build -o /go/bin/v2ray \
|
&& go build -o /go/bin/v2ray \
|
||||||
&& cd ../infra/control/main \
|
&& cd ../infra/control/main \
|
||||||
&& go build -o /go/bin/v2ctl
|
&& go build -o /go/bin/v2ctl \
|
||||||
|
&& git clone https://github.com/v2ray/geoip.git \
|
||||||
|
&& cd geoip \
|
||||||
|
&& go get -d \
|
||||||
|
&& go build -o /go/bin/geoip \
|
||||||
|
&& GEOSITE_TAG="$(wget -qO- "https://api.github.com/repos/v2ray/domain-list-community/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')" \
|
||||||
|
&& wget -O /go/bin/geosite.dat "https://github.com/v2ray/domain-list-community/releases/download/${GEOSITE_TAG}/dlc.dat" \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& wget -O GeoLite2-Country-CSV.zip http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip \
|
||||||
|
&& unzip GeoLite2-Country-CSV.zip \
|
||||||
|
&& rm -fv GeoLite2-Country-CSV.zip \
|
||||||
|
&& mv GeoLite2* geoip \
|
||||||
|
&& /go/bin/geoip --country=./geoip/GeoLite2-Country-Locations-en.csv --ipv4=./geoip/GeoLite2-Country-Blocks-IPv4.csv --ipv6=./geoip/GeoLite2-Country-Blocks-IPv6.csv \
|
||||||
|
&& mv geoip.dat /go/bin/
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
LABEL maintainer="Teddysun <i@teddysun.com>"
|
LABEL maintainer="Teddysun <i@teddysun.com>"
|
||||||
@ -27,8 +40,8 @@ RUN set -ex \
|
|||||||
|
|
||||||
COPY --from=builder /go/bin/v2ray /usr/bin
|
COPY --from=builder /go/bin/v2ray /usr/bin
|
||||||
COPY --from=builder /go/bin/v2ctl /usr/bin
|
COPY --from=builder /go/bin/v2ctl /usr/bin
|
||||||
COPY --from=builder /go/src/github.com/v2ray/v2ray-core/release/config/geoip.dat /usr/bin
|
COPY --from=builder /go/bin/geoip.dat /usr/bin
|
||||||
COPY --from=builder /go/src/github.com/v2ray/v2ray-core/release/config/geosite.dat /usr/bin
|
COPY --from=builder /go/bin/geosite.dat /usr/bin
|
||||||
COPY config.json /etc/v2ray/config.json
|
COPY config.json /etc/v2ray/config.json
|
||||||
VOLUME /etc/v2ray
|
VOLUME /etc/v2ray
|
||||||
|
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{
|
||||||
"log" : {
|
|
||||||
"access": "/var/log/v2ray/access.log",
|
|
||||||
"error": "/var/log/v2ray/error.log",
|
|
||||||
"loglevel": "warning"
|
|
||||||
},
|
|
||||||
"inbounds": [{
|
"inbounds": [{
|
||||||
"port": 9000,
|
"port": 9000,
|
||||||
"protocol": "vmess",
|
"protocol": "vmess",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user