debian11 distroless

This commit is contained in:
Benjamin Elder
2022-02-07 20:36:18 -08:00
parent 5e3a7afd7d
commit 53d0fd7536
2 changed files with 4 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ RUN mkdir -p "${STAGE_DIR}" && \
# See: https://github.com/GoogleContainerTools/distroless/tree/main/base
# See: https://github.com/GoogleContainerTools/distroless/tree/main/cc
# This has /etc/passwd, tzdata, cacerts, glibc, libssl, openssl, and libgcc1
FROM "gcr.io/distroless/cc"
FROM "gcr.io/distroless/cc-debian11"
ARG STAGE_DIR="/opt/stage"

View File

@@ -87,8 +87,10 @@ main(){
# stage the dependencies of the binary
while IFS= read -r c_dep; do
# skip libc, libgcc1 we already have this in the distroless images
# NOTE: debian10 -> libggc1, debian11 -> libgcc-s1
# https://github.com/GoogleContainerTools/distroless/blob/47cf1c0554fdfc71604af0b8f6e19072f62e4f93/cc/BUILD#L10-L14
pkg="$(file_to_package "${c_dep}")"
if [[ "${pkg}" == "libc6" || "${pkg}" == "libgcc1" ]]; then
if [[ "${pkg}" == "libc6" || "${pkg}" == "libgcc1" || "${pkg}" == "libgcc-s1" ]]; then
continue
fi
# otherwise stage dependency