-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
56 lines (51 loc) · 1.9 KB
/
Containerfile
File metadata and controls
56 lines (51 loc) · 1.9 KB
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
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.26.2 AS builder
ARG TARGETOS
ARG TARGETARCH
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get --no-install-suggests --no-install-recommends -o Dpkg::Options::="--force-confnew" --allow-downgrades --allow-remove-essential \
--allow-change-held-packages -fuy install \
\
ca-certificates \
curl \
lsb-release \
\
&& \
curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
printf "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list && \
apt-get update && \
apt-get install vault && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /glci
COPY go.mod go.mod
COPY go.sum go.sum
COPY cmd/ cmd/
COPY internal/ internal/
ARG version=dev
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o glci \
-ldflags "-X main.version=${version}" github.com/gardenlinux/glci/cmd
FROM docker.io/library/debian:forky-20260421-slim
WORKDIR /
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get --no-install-suggests --no-install-recommends -o Dpkg::Options::="--force-confnew" --allow-downgrades --allow-remove-essential \
--allow-change-held-packages -fuy install \
\
ca-certificates \
curl \
jq \
\
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/bin/vault /usr/bin/vault
ENTRYPOINT ["/glci"]
COPY --from=builder /glci/glci .
COPY glci.yaml glci.yaml
COPY glci_2150.yaml glci_2150.yaml
COPY glci_1877.yaml glci_1877.yaml
COPY glci_1592.yaml glci_1592.yaml
COPY glci_integration_test.yaml glci_integration_test.yaml
COPY glci_dev.yaml glci_dev.yaml
USER 65532:65532