Skip to content

Commit

Permalink
Use distroless Docker base image.
Browse files Browse the repository at this point in the history
Signed-off-by: s3rj1k <[email protected]>
  • Loading branch information
s3rj1k committed Aug 17, 2023
1 parent d01ddd0 commit 2daddde
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ARG BUILDER_IMAGE=golang:1.20-alpine

# Image used as base image.
ARG BASE_IMAGE=alpine:latest
ARG BASE_IMAGE=gcr.io/distroless/static

# Use builder image to build binaries.
FROM ${BUILDER_IMAGE} AS builder
Expand All @@ -28,7 +28,13 @@ COPY . .
RUN --mount=type=ssh make GOPROXY=${GOPROXY} all

# Use base image.
FROM ${BASE_IMAGE}
FROM ${BASE_IMAGE} AS base

# Use empty image as backing base image.
FROM scratch

# Copy everything into backing base image from base image.
COPY --from=base . .

# Set workdir for base image.
WORKDIR /
Expand Down

0 comments on commit 2daddde

Please sign in to comment.