forked from PasarGuard/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (18 loc) · 704 Bytes
/
Dockerfile
File metadata and controls
28 lines (18 loc) · 704 Bytes
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
FROM --platform=$BUILDPLATFORM golang:1.26.2-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
RUN apk update && apk add --no-cache make
WORKDIR /src
COPY go* .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} make NAME=main build
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make install_xray
FROM alpine:latest
LABEL org.opencontainers.image.source="https://github.com/PasarGuard/node"
RUN apk update && apk add --no-cache wireguard-tools nftables iproute2 procps
WORKDIR /app
COPY --from=builder /src/main /app/main
COPY --from=builder /usr/local/bin/xray /usr/local/bin/xray
COPY --from=builder /usr/local/share/xray /usr/local/share/xray
ENTRYPOINT ["./main"]