Skip to content

Commit 4f1bccd

Browse files
committed
Explain example preflight.yaml in image
Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
1 parent 7d8341d commit 4f1bccd

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

Dockerfile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
# STAGE 1
2-
FROM golang:1.13.4 as builder
1+
# STAGE 1
2+
FROM golang:1.13.4 as builder
33

4-
WORKDIR /go/github.com/jetstack/preflight
4+
WORKDIR /go/github.com/jetstack/preflight
55

6-
# Run a dependency resolve with just the go mod files present for
7-
# better caching
8-
COPY ./go.mod .
9-
COPY ./go.sum .
6+
# Run a dependency resolve with just the go mod files present for
7+
# better caching
8+
COPY ./go.mod .
9+
COPY ./go.sum .
1010

11-
RUN go mod download
11+
RUN go mod download
1212

13-
## Bring in everything else and build an amd64 image
14-
COPY . .
15-
RUN GOOS=linux GOARCH=amd64 go install .
13+
## Bring in everything else and build an amd64 image
14+
COPY . .
15+
RUN GOOS=linux GOARCH=amd64 go install .
1616

17-
# STAGE 2
18-
# Use a distroless nonroot base image for just our executable
19-
FROM gcr.io/distroless/base:nonroot
20-
COPY --from=builder /go/bin/preflight /bin/preflight
21-
ADD ./preflight-packages /preflight-packages
22-
ADD ./examples/pods.preflight.yaml /etc/preflight/preflight.yaml
23-
ENTRYPOINT ["preflight"]
24-
CMD ["check", "--config-file", "/etc/preflight/preflight.yaml"]
17+
# STAGE 2
18+
# Use a distroless nonroot base image for just our executable
19+
FROM gcr.io/distroless/base:nonroot
20+
COPY --from=builder /go/bin/preflight /bin/preflight
21+
ADD ./preflight-packages /preflight-packages
22+
# load in an example preflight.yaml
23+
ADD ./examples/pods.preflight.yaml /etc/preflight/preflight.yaml
24+
ENTRYPOINT ["preflight"]
25+
CMD ["check", "--config-file", "/etc/preflight/preflight.yaml"]

0 commit comments

Comments
 (0)