aws / aws-lambda-base-images

Apache License 2.0
669 stars 109 forks source link

Can't yum install packages on latest python release #124

Closed portswigger-katie closed 10 months ago

portswigger-katie commented 10 months ago

Has the base image changed from centos to a different distro?

[1/5] FROM docker.io/amazon/aws-lambda-python:latest@sha256:80ed3cce65e8b1bbe73d99cdd02da4a95f615923f33d913d5d4755991a713f4b [2/5] RUN yum update -y && yum install -y python3 python3-dev python3-pip gcc && rm -Rf /var/cache/yum: 0.190 /bin/sh: line 1: yum: command not found<

Dockerfile:4 LABEL maintainer="Mystery" RUN yum update -y && \ yum install -y python3 python3-dev python3-pip gcc && \ rm -Rf /var/cache/yum COPY ./src/requirements.txt ./<

ERROR: failed to solve: process "/bin/sh -c yum update -y && yum install -y python3 python3-dev python3-pip gcc && rm -Rf /var/cache/yum" did not complete successfully: exit code: 127<

Victor-DS commented 10 months ago

My understanding is that they changed to Amazon Linux [1], and the package manager changed from yum to dnf. So, if anybody else bumps into this issue, try replacing it to use dnf and hopefully it should work.

[1] https://aws.amazon.com/blogs/compute/introducing-the-amazon-linux-2023-runtime-for-aws-lambda/

smirnoal commented 10 months ago

python:latest is using AmazonLinux2023-minimal as a base. You should be able to install packages to it with dnf command