Skip to content

Commit 98ea747

Browse files
author
Boris
committed
add Dockerfile
1 parent b34c71c commit 98ea747

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
for GOOS in linux; do
2525
for GOARCH in amd64 arm64; do
2626
export GOOS GOARCH
27-
CGO_ENABLED=0 go build -v -a -tags netgo -ldflags="-extldflags '-static' -s -w $versionflags" -o build/osctl-${GOOS}-${GOARCH} cmd/main.go
27+
CGO_ENABLED=0 go build -v -a -tags netgo -ldflags="-extldflags '-static' -s -w $versionflags" -o build/wg-${GOOS}-${GOARCH} cmd/main.go
2828
done
2929
done
3030
cd build; sha256sum * > sha256sums.txt

Dockerfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM golang:1.25-bookworm AS builder
2+
3+
ARG versionflags
4+
5+
WORKDIR /app
6+
7+
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
8+
9+
COPY go.mod go.sum ./
10+
RUN go mod download
11+
12+
COPY . .
13+
14+
RUN CGO_ENABLED=0 go build -v -a -tags netgo -ldflags="-extldflags '-static' -s -w $versionflags" -o wg cmd/main.go
15+
16+
FROM debian:bookworm-slim
17+
18+
WORKDIR /app
19+
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
22+
RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \
23+
ca-certificates \
24+
curl \
25+
wget \
26+
dnsutils \
27+
iputils-ping \
28+
vim \
29+
nano \
30+
jq \
31+
lsof \
32+
net-tools \
33+
procps \
34+
tzdata \
35+
traceroute \
36+
mtr-tiny \
37+
&& rm -rf /var/lib/apt/lists/*
38+
39+
COPY --from=builder /app/wg /app/wg
40+
41+
RUN chmod +x /app/wg
42+
43+
ENV PATH="/app:${PATH}"

0 commit comments

Comments
 (0)