-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.in
40 lines (29 loc) · 944 Bytes
/
Dockerfile.in
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
FROM golang:<GO_VERSION>-alpine AS base
WORKDIR /app
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "10001" \
"appuser"
COPY vendor vendor
COPY go.mod go.sum ./
COPY cmd cmd
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./cmd/cfgenerator
FROM scratch
WORKDIR /app
COPY --from=base /etc/passwd /etc/passwd
COPY --from=base /etc/group /etc/group
COPY --from=base /app/cfgenerator .
USER appuser:appuser
ARG GIT_REPOSITORY=
ARG GIT_SHA=
ARG CREATED_AT=
LABEL org.opencontainers.image.created="$CREATED_AT" \
org.opencontainers.image.source="$GIT_REPOSITORY" \
org.opencontainers.image.revision="$GIT_SHA" \
org.opencontainers.image.title="Cfgenerator command line" \
org.opencontainers.image.description="Configure JSON files using JSONNET and configmap/secret folders"
ENTRYPOINT ["/app/cfgenerator"]