1 Answer
- Newest
- Most votes
- Most comments
0
to install python modules, use empty LD_LIBRARY_PATH environment variable:
FROM public.ecr.aws/lambda/nodejs:20
RUN dnf upgrade -y
########## CUSTOM ######################
RUN dnf install -y \
python3 \
&& \
dnf clean all
########## NODE ######################
RUN npm install -g esbuild yarn typescript && \
npm cache clean --force
# ########## AWS SAM ######################
RUN LD_LIBRARY_PATH="" pip3 install --no-cache-dir --upgrade awscli aws-sam-cli
To confirm CLI and SAM were working, docker exec -it <containerid> sh
into a running container, and my aws --version
command failed with urllib3 not finding ssl, but I noticed that my shell had LD_LIBRARY_PATH=/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib
- setting LD_LIBRARY_PATH=""
in my shell let me successfully run CLI and SAM from the shell to check their versions:
sh-5.2# LD_LIBRARY_PATH=""
sh-5.2# aws --version
aws-cli/1.30.3 Python/3.9.16 Linux/6.3.13-linuxkit botocore/1.32.3
sh-5.2# sam --version
SAM CLI, version 1.103.0
answered 10 months ago
Relevant content
- asked 8 months ago
- asked 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 5 months ago
Thanks for your comment, emptying
LD_LIBRARY_PATH
did help.