这是我的 Dockerfile
# python3.8 lambda base image
FROM public.ecr.aws/lambda/python:3.8
# copy requirements.txt to container
COPY requirements.txt ./
# installing dependencies
RUN pip3 install --upgrade --ignore-installed pip setuptools
RUN pip3 install -r requirements.txt
# Copy function code to container
COPY feature_info.py ./
COPY s3_file ./
COPY app.py ./
# setting the CMD to your handler file_name.function_name
CMD [ "app.lambda_handler" ]
这是我的要求.txt
requests
tensorflow
pandas
numpy
sklearn
scipy
Pillow
如果我用 ecr 制作 lambda 容器并制作 lambda 函数,它会因为导入 tensorflow 而超时......其他导入效果很好