-
Notifications
You must be signed in to change notification settings - Fork 26
/
Containerfile.test
64 lines (59 loc) · 1.46 KB
/
Containerfile.test
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM docker.io/library/golang:1.22-alpine as build
WORKDIR /src
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build \
-ldflags="-extldflags=-static" \
-o ./dist/nexd ./cmd/nexd
RUN CGO_ENABLED=0 go build \
-ldflags="-extldflags=-static" \
-o ./dist/nexctl ./cmd/nexctl
FROM alpine:3.16 as alpine
RUN apk add --no-cache \
iputils \
nftables \
psmisc \
ca-certificates
COPY --from=build /src/dist/nexd /bin/nexd
COPY --from=build /src/dist/nexctl /bin/nexctl
COPY ./hack/update-ca.sh /update-ca.sh
RUN chmod a+x /update-ca.sh
FROM fedora:latest as fedora
RUN dnf update -qy && \
dnf install --setopt=install_weak_deps=False -qy \
ca-certificates \
iputils \
iproute \
psmisc \
procps-ng \
nftables \
hostname \
&& \
dnf clean all
COPY --from=build /src/dist/nexd /bin/nexd
COPY --from=build /src/dist/nexctl /bin/nexctl
COPY ./hack/update-ca.sh /update-ca.sh
RUN chmod a+x /update-ca.sh
FROM ubuntu:22.04 as ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qy && \
apt-get install --no-install-recommends -qy \
ca-certificates \
iputils-ping \
iproute2 \
nftables \
net-tools \
traceroute \
tcpdump \
conntrack \
psmisc \
curl \
python3 \
&& \
apt-get clean
COPY --from=build /src/dist/nexd /bin/nexd
COPY --from=build /src/dist/nexctl /bin/nexctl
COPY ./hack/update-ca.sh /update-ca.sh
RUN chmod a+x /update-ca.sh