Skip to content

Update base image to Debian Bookworm #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

lalten
Copy link

@lalten lalten commented Apr 30, 2025

  • Just using bookworm-slim instead of bullseye-slim seems to work well
  • Building the Dockerfile (not Dockerfile-base) needs --break-system-packages, otherwise it complains:
error: externally-managed-environment
 => ERROR [ 4/19] RUN sed -i "s|version='.*'|version=\'99.0.0\'|" /tmp/setup.py  && pip install --no-cache-dir /tmp  && rm -rf /tmp/src /tmp/setup.py                                             0.5s
------
 > [ 4/19] RUN sed -i "s|version='.*'|version=\'99.0.0\'|" /tmp/setup.py  && pip install --no-cache-dir /tmp  && rm -rf /tmp/src /tmp/setup.py:
0.442 error: externally-managed-environment
0.442
0.442 × This environment is externally managed
0.442 ╰─> To install Python packages system-wide, try apt install
0.442     python3-xyz, where xyz is the package you are trying to
0.442     install.
0.442
0.442     If you wish to install a non-Debian-packaged Python package,
0.442     create a virtual environment using python3 -m venv path/to/venv.
0.442     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
0.442     sure you have python3-full installed.
0.442
0.442     If you wish to install a non-Debian packaged Python application,
0.442     it may be easiest to use pipx install xyz, which will manage a
0.442     virtual environment for you. Make sure you have pipx installed.
0.442
0.442     See /usr/share/doc/python3.11/README.venv for more information.
0.442
0.442 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
0.442 hint: See PEP 668 for the detailed specification.
------
Dockerfile:11
--------------------
  10 |     COPY setup.py /tmp
  11 | >>> RUN sed -i "s|version='.*'|version=\'${VERSION}\'|" /tmp/setup.py \
  12 | >>>  && pip install --no-cache-dir /tmp \
  13 | >>>  && rm -rf /tmp/src /tmp/setup.py
  14 |
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c sed -i \"s|version='.*'|version=\\'${VERSION}\\'|\" /tmp/setup.py  && pip install --no-cache-dir /tmp  && rm -rf /tmp/src /tmp/setup.py" did not complete successfully: exit code: 1

The locally built image seems to work and uses a more modern Python (see #381)

docker run --rm -it sha256:84cba8d4afdfc035bfbe3d4f4503e35dd830b21ff63c504ffe2ed43a1a21ca43 python3 -V
Python 3.11.2docker run --rm -it sha256:84cba8d4afdfc035bfbe3d4f4503e35dd830b21ff63c504ffe2ed43a1a21ca43 terraform-version
Version not specified, using the latest release version
::debug::Downloading signature from https://releases.hashicorp.com/terraform/1.11.4/terraform_1.11.4_SHA256SUMS.72D7468F.sig
::debug::Downloading checksums from https://releases.hashicorp.com/terraform/1.11.4/terraform_1.11.4_SHA256SUMS
gpg: Signature made Wed Apr  9 13:35:39 2025 UTC
gpg:                using RSA key 374EC75B485913604A831CC7C820C6D5CD27AB87
gpg: Good signature from "HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>" [ultimate]
::debug::Downloading archive from https://releases.hashicorp.com/terraform/1.11.4/terraform_1.11.4_linux_amd64.zip
terraform_1.11.4_linux_amd64.zip: OK
Switched to Terraform v1.11.4

Closes #381

@lalten
Copy link
Author

lalten commented May 13, 2025

@dflook could you have a look please?

@lalten
Copy link
Author

lalten commented May 29, 2025

Friendly bump @dflook , any opinions on this?

@dflook
Copy link
Owner

dflook commented May 29, 2025

Hi @lalten, this looks like a good change. This would have been done when bookworm released if not for the bookworm image being bigger than bullseye.

bullseye has LTS for another year, but this should be done before Python 3.9 end of life later this year.

This may be a breaking change for some, so I'm planning to include it in a v2.0.0 soon.

@dflook
Copy link
Owner

dflook commented Jun 3, 2025

This was included in v2.0.0 🎉

@dflook dflook closed this Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade Debian base image
2 participants