Skip to content

Commit

Permalink
Fix build stage label truncation (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhoefler authored Feb 5, 2023
1 parent 26c5ec7 commit e0d71e5
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 109 deletions.
12 changes: 3 additions & 9 deletions examples/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
### TLS root certs and non-root user
### TLS root certs
FROM ubuntu:latest@sha256:b6b83d3c331794420340093eb706a6f152d9c1fa51b262d9bf34594887c2c7ac AS ubuntu

RUN \
# Note that the lack of a "lock" mechanism for apt dependencies
# currently prevents a fully reproducible build
apt-get update \
&& apt-get install -y --no-install-recommends \
# Install TLS root certificates
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# ---

FROM golang:1.18.4@sha256:6e10f44d212b24a3611280c8035edaf9d519f20e3f4d8f6f5e26796b738433da AS build
FROM golang:1.18.4@sha256:6e10f44d212b24a3611280c8035edaf9d519f20e3f4d8f6f5e26796b738433da AS build-tool-dependencies
RUN --mount=type=cache,from=buildcache,source=/go/pkg/mod/cache/,target=/go/pkg/mod/cache/ go build

# ---

### Release image
FROM scratch AS release

# Copy the TLS certificates for encrypted network communication
COPY --from=ubuntu /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt

COPY --from=build . .
COPY --from=build-tool-dependencies . .

ENTRYPOINT ["/example"]
Loading

0 comments on commit e0d71e5

Please sign in to comment.