-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (28 loc) · 867 Bytes
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM node:18.18.2-bullseye AS node
WORKDIR /src/assets
COPY ./assets/package*.json .
RUN npm ci
COPY ./assets .
COPY ./templates ../templates
RUN npm run prod
FROM golang:1.21.13-bookworm AS builder
WORKDIR /src
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
ca-certificates
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
COPY --from=node /src/dist dist
ARG GOARCH=amd64
RUN go generate \
&& CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH go build -a -tags netgo -ldflags '-extldflags "-static" -s -w' -o ./kubico
FROM debian:12.1-slim AS debian
COPY --from=builder /src/kubico /usr/local/bin
CMD ["kubico"]
FROM scratch AS scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=builder /src/kubico /
COPY --from=builder /etc/passwd /etc/passwd
CMD ["/kubico"]