Skip to content

Commit 410b8a0

Browse files
authored
Reducing the number of layers in an image
small revision of the dockerfile - removed the extra layer
1 parent 26fb33d commit 410b8a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

images/image-awaiter/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ FROM golang:1.18
33

44
# VULN_SCAN_TIME=
55

6-
RUN mkdir -p /build/
7-
COPY *.mod *.go *.sum /build/
86
WORKDIR /build
9-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s' -installsuffix cgo -a -o out/image-awaiter
7+
COPY *.mod \
8+
*.go \
9+
*.sum \
10+
.
1011

12+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s' -installsuffix cgo -a -o out/image-awaiter
1113

1214
# present the result within a slimmed image
1315
FROM scratch
1416

1517
COPY --from=0 /build/out/image-awaiter /image-awaiter
1618

17-
18-
1919
# To debug / develop this code
2020
# ----------------------------
2121
# 1. Setup a kubectl proxy

0 commit comments

Comments
 (0)