mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 09:58:14 -05:00
19 lines
524 B
Docker
19 lines
524 B
Docker
# Build go
|
|
FROM golang:1.18.1-alpine AS builder
|
|
WORKDIR /app
|
|
COPY . .
|
|
ENV CGO_ENABLED=0
|
|
RUN go mod download && \
|
|
go env -w GOFLAGS=-buildvcs=false && \
|
|
go build -v -o XrayR -trimpath -ldflags "-s -w -buildid=" ./main
|
|
|
|
# Release
|
|
FROM alpine
|
|
# 安装必要的工具包
|
|
RUN apk --update --no-cache add tzdata ca-certificates && \
|
|
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
|
mkdir /etc/XrayR/
|
|
COPY --from=builder /app/XrayR /usr/local/bin
|
|
|
|
ENTRYPOINT [ "XrayR", "--config", "/etc/XrayR/config.yml"]
|