Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ ENV PYTHON_VERSION_DEFAULT=3.14
# These are the non "-dev" versions of the libraries used in the builder.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
# TODO(https://github.com/googleapis/google-cloud-python/issues/14992): Remove gdb
# Once this bug is fixed.
# Temporarily add gdb to assist with remote debugging for issue 14992.
gdb \
Comment on lines +95 to +98
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding gdb is understandable for temporary debugging, committing it to the main Dockerfile increases the image size and potential attack surface. A better practice is to use a multi-stage build to isolate debugging tools.

You could define a separate debug stage that builds upon the main image and only adds gdb. This keeps the default image lean and secure, while allowing a debug-enabled version to be built on demand (e.g., docker build --target debug ...).

Example of a debug stage:

FROM builder as debug
RUN apt-get update && apt-get install -y --no-install-recommends gdb && rm -rf /var/lib/apt/lists/*

Since this is a temporary change with a TODO, it's acceptable. However, please consider this pattern for future needs to maintain a clean base image.

# This is needed to avoid the following error:
# `ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory`.
# `libsqlite3-0` is used by the `coverage` PyPI package which is used when testing libraries
Expand Down
Loading