I'm trying to build a TensorFlow container to deploy to Lambda (following the instructions here).
My dockerfile file is:
FROM public.ecr.aws/lambda/python:3.8 # Copy function code COPY app.py ${LAMBDA_TASK_ROOT} # Install the function's dependencies using file requirements.txt # from your project folder. COPY requirements.txt . RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) CMD [ "app.handler" ] while my requirement.txt is
tensorflow==2.4.0 and the error I'm getting when I build the docker container is:
#8 0.653 ERROR: Could not find a version that satisfies the requirement tensorflow==2.4.0 (from versions: none) #8 0.653 ERROR: No matching distribution found for tensorflow==2.4.0 #8 0.847 WARNING: You are using pip version 21.1.1; however, version 21.3.1 is available. #8 0.847 You should consider upgrading via the '/var/lang/bin/python3.8 -m pip install --upgrade pip' command. ------ executor failed running [/bin/sh -c pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"]: exit code: 1 Things I've tried
- Other python libraries (Scikit learn, numpy) install fine
- TF requirements are met. Python >= 3.8 && running 68 bit version
- Removing the lambda task root has no effect.
- Changing the TensorFlow version
The only thing I can guess is the base image does not support TF, but I can't see why?