Create the smallest and secured golang docker image based on scratch
C Hemidy
1.3K14

Great article, thanks.
The quotes in the Dockerfile have become ‘pretty’ and should be

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s" -o /go/bin/hello
# Instead of
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags=”-w -s” -o /go/bin/hello