-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 851 Bytes
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 851 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM golang:1.25-bookworm AS builder
ARG versionflags
WORKDIR /app
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -v -a -tags netgo -ldflags="-extldflags '-static' -s -w $versionflags" -o wg cmd/main.go
FROM debian:bookworm-slim
WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
dnsutils \
iputils-ping \
vim \
nano \
jq \
lsof \
net-tools \
procps \
tzdata \
traceroute \
mtr-tiny \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/wg /app/wg
RUN chmod +x /app/wg
ENV PATH="/app:${PATH}"