aws / aws-lambda-builders

Python library to compile, build & package AWS Lambda functions for several runtimes & framework
Apache License 2.0
333 stars 137 forks source link

Bug: dnf command does not work on version of public.ecr.aws/lambda/python:3.11-x86_64 publish around 2023.12.05 16:00 UTC #586

Closed loesak closed 9 months ago

loesak commented 9 months ago

Description:

We've been using the image public.ecr.aws/lambda/python:3.11-x86_64 for building our Python based Lambda ZIP artifacts for use by the AWS Lambda Python 3.11 runtime. We are not using the image for building other Docker images for running a Docker based AWS Lambda runtimes (please let me know if this is not a supported use case for this Docker image). However, I believe this is an issue for also building subsequent Docker images. It seems recently the base image was updated and the deprecated yum command is no longer present and the dnf command should be used instead to install OS packages. However, when running the dnf command, results in an error.

dnf: /var/lang/lib/liblzma.so.5: version `XZ_5.2' not found (required by /lib64/librpmio.so.9)

This is preventing us from installing needed dependencies we need for performing our build but I assume it would also be needed to install any OS packages for any Docker image based off this image.

Steps to reproduce:

Start a container based on this image:

docker run --rm -it --entrypoint /bin/bash public.ecr.aws/lambda/python:3.11-x86_64

or to pin to the image where this issue was discovered:

docker run --rm -it --entrypoint /bin/bash public.ecr.aws/lambda/python@sha256:9c593e44c6936fd4335405ab3e3dea55f6a38cab5c009a43cc7e01c2e3eef81e

then try to run the dnf command:

bash-5.2# dnf --help
dnf: /var/lang/lib/liblzma.so.5: version `XZ_5.2' not found (required by /lib64/librpmio.so.9)

bash-5.2# dnf install zip
dnf: /var/lang/lib/liblzma.so.5: version `XZ_5.2' not found (required by /lib64/librpmio.so.9)

Observed result:

dnf: /var/lang/lib/liblzma.so.5: version `XZ_5.2' not found (required by /lib64/librpmio.so.9)

Expected result:

Expected dnf command to execute successfully w/o error

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

None

loesak commented 9 months ago

I am unsure if this is the correct repository for this issue or if it should exist over here: https://github.com/aws/aws-lambda-base-images/issues

loesak commented 9 months ago

Issue has been resolved and discussion occurred in https://github.com/aws/aws-lambda-base-images/issues