-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (27 loc) · 1.12 KB
/
Dockerfile
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
FROM golang:1.23-alpine3.20 as builder
LABEL org.opencontainers.image.source=https://github.com/mudler/edgevpn
LABEL org.opencontainers.image.description="⛵ The immutable, decentralized, statically built p2p VPN without any central server and automatic discovery! Create decentralized introspectable tunnels over p2p with shared tokens"
LABEL org.opencontainers.image.licenses=Apache-2.0
ARG version
RUN apk --no-cache add git &&\
git clone --depth=1 --branch v0.28.3 https://github.com/mudler/edgevpn.git /tmp/edgevpn &&\
cd /tmp/edgevpn &&\
export commit=$(git rev-parse HEAD) &&\
go build -v -ldflags "-s -w -X 'github.com/mudler/edgevpn/internal.Version=${version:-dev}' -X 'github.com/mudler/edgevpn/internal.Commit=${commit:-dev}'" -o /edgevpn &&\
cd - &&\
rm -rf /tmp/edgevpn
FROM alpine:3.20
WORKDIR /
ENV USER=edgevpn
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}" && \
apk add --update --no-cache tzdata curl
COPY --from=builder /edgevpn .
ENTRYPOINT ["/edgevpn"]