-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (17 loc) · 739 Bytes
/
Dockerfile
File metadata and controls
20 lines (17 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Build go
FROM golang:1.23.1-alpine AS builder
WORKDIR /app
COPY . .
ENV CGO_ENABLED=0
RUN go mod download \
&& go build -v -o XrayR -trimpath -ldflags "-s -w -buildid="
# Release
FROM alpine:latest
# 安装必要的工具包
RUN apk --update --no-cache add curl tzdata ca-certificates \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& mkdir /etc/XrayR/ \
&& curl -L "https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geoip.dat" -o /etc/XrayR/geoip.dat \
&& curl -L "https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat" -o /etc/XrayR/geosite.dat
COPY --from=builder /app/XrayR /usr/local/bin
ENTRYPOINT [ "XrayR", "--config", "/etc/XrayR/config.yml"]