Skip to content

Commit

Permalink
Reducing the number of layers in an image
Browse files Browse the repository at this point in the history
small revision of the dockerfile - removed the extra layer
  • Loading branch information
alekseyolg authored Mar 31, 2023
1 parent 26fb33d commit 410b8a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions images/image-awaiter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ FROM golang:1.18

# VULN_SCAN_TIME=

RUN mkdir -p /build/
COPY *.mod *.go *.sum /build/
WORKDIR /build
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-w -s' -installsuffix cgo -a -o out/image-awaiter
COPY *.mod \
*.go \
*.sum \
.

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

# present the result within a slimmed image
FROM scratch

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



# To debug / develop this code
# ----------------------------
# 1. Setup a kubectl proxy
Expand Down

0 comments on commit 410b8a0

Please sign in to comment.