Skip to content

Commit

Permalink
docs: use static distroless image (#147)
Browse files Browse the repository at this point in the history
Since CGO is not required for this example, we can use the
distroless static-debian11 image. This reduces the size of the image by
18 MB. Although this is just an example, I figured it would be nice show
the usage of this static image in the docs.

```
counter-basic-static latest  635b8094b79a   10 seconds ago   10.6MB
counter-basic        latest  047d3cd36484   2 minutes ago    28.6MB
```
  • Loading branch information
KasonBraley authored Sep 15, 2023
1 parent f9004fa commit c36cc4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ COPY . /app
RUN CGO_ENABLED=0 GOOS=linux go build -o /entrypoint

# Deploy.
FROM gcr.io/distroless/base-debian11 AS release-stage
FROM gcr.io/distroless/static-debian11 AS release-stage
WORKDIR /
COPY --from=build-stage /entrypoint /entrypoint
// highlight-next-line
Expand Down
2 changes: 1 addition & 1 deletion examples/counter-basic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY . /app
RUN CGO_ENABLED=0 GOOS=linux go build -o /entrypoint

# Deploy.
FROM gcr.io/distroless/base-debian11 AS release-stage
FROM gcr.io/distroless/static-debian11 AS release-stage
WORKDIR /
COPY --from=build-stage /entrypoint /entrypoint
COPY --from=build-stage /app/assets /assets
Expand Down

0 comments on commit c36cc4f

Please sign in to comment.