Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Update base docker images to use Debian 12 distroless base image (#928)
Browse files Browse the repository at this point in the history
Instead of chasing ever-changing commit hashes, just use the apppropriate
tag for the distroless image. This aligns things to how `teleport` is handled.

Additionally, standardize on Debian 12 for everything (instead of a mix of 11 and 12).
Also, use `static` over `base`. This means no `glibc` or `libssl`, which should be fine for these plugins.
  • Loading branch information
reedloden authored Sep 26, 2023
1 parent 196af73 commit efa67e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions access/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build the plugin binary
ARG GO_VERSION
ARG BASE_IMAGE=gcr.io/distroless/static-debian12

FROM golang:${GO_VERSION}-bullseye as builder
FROM golang:${GO_VERSION}-bookworm as builder

ARG ACCESS_PLUGIN
ARG GITREF
Expand All @@ -22,7 +23,7 @@ RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/base@sha256:03dcbf61f859d0ae4c69c6242c9e5c3d7e1a42e5d3b69eb235e81a5810dd768e
FROM $BASE_IMAGE
ARG ACCESS_PLUGIN
COPY --from=builder /workspace/access/${ACCESS_PLUGIN}/build/teleport-${ACCESS_PLUGIN} /usr/local/bin/teleport-plugin

Expand Down
5 changes: 3 additions & 2 deletions event-handler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build the plugin binary
ARG GO_VERSION
ARG BASE_IMAGE=gcr.io/distroless/static-debian12

FROM golang:${GO_VERSION}-bullseye as builder
FROM golang:${GO_VERSION}-bookworm as builder

ARG GITREF

Expand All @@ -21,7 +22,7 @@ RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/base@sha256:03dcbf61f859d0ae4c69c6242c9e5c3d7e1a42e5d3b69eb235e81a5810dd768e
FROM $BASE_IMAGE

COPY --from=builder /workspace/event-handler/build/teleport-event-handler /usr/local/bin/teleport-event-handler

Expand Down
2 changes: 1 addition & 1 deletion event-handler/build.assets/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG GO_VER
FROM golang:${GO_VER}-bullseye
FROM golang:${GO_VER}-bookworm

ARG UID
ARG GID
Expand Down

0 comments on commit efa67e1

Please sign in to comment.