0

I am trying to build an image with the following Dockerfile:

FROM public.ecr.aws/lambda/python:3.8

COPY app.py requirements.txt __init__.py ./
ADD models models
Add utils utils

RUN python3.8 -m pip install -r requirements.txt -t .

# Command can be overwritten by providing a different command in the template directly.
CMD ["app.lambda_handler"]

The requirements are as follows:

-f https://download.pytorch.org/whl/torch_stable.html
torch==1.8.0+cpu

appnope==0.1.0
backcall==0.2.0
certifi==2020.12.5
chardet==4.0.0
colorama==0.4.3
cycler==0.10.0
decorator==4.4.2
docutils==0.15.2
dotmap==1.3.23
idna==2.10
ipython==7.18.1
ipython-genutils==0.2.0
jedi==0.18.0
jmespath==0.10.0
jupyter-client==6.1.7
jupyter-core==4.6.3
kiwisolver==1.3.1
matplotlib==3.4.2
numpy==1.20.3
opencv-python==4.5.2.52
pandas==1.2.4
parso==0.8.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.2.0
pip==21.1.2
prompt-toolkit==3.0.8
ptyprocess==0.6.0
pyasn1==0.4.8
Pygments==2.7.1
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
pyzmq==19.0.2
requests==2.25.1
rsa==4.5
scipy==1.6.3
seaborn==0.11.1
setuptools==57.0.0
six==1.16.0
smart-open==5.1.0
tornado==6.0.4
tqdm==4.61.0
traitlets==5.0.5
typing-extensions==3.10.0.0
urllib3==1.26.4
wcwidth==0.2.5
wheel==0.36.2

This causes the error mentioned in a title, when I try to invoke locally:

Unable to import module 'app': libGL.so.1: cannot open shared object file: No such file or directory

I have found help concerning this problem in this thread for example, but everything I found corresponds to linux. Is there any solution for this problem on Mac?

Thanks a lot!

spadel
  • 998
  • 2
  • 16
  • 40
  • I'd suggest you tag this with `docker` as well. Also, are you sure solutions for Linux aren't applicable to your case? I'm not sure how Docker on MacOS is implemented, but I could imagine that it's an adaptation layer to run Linux code. – Ulrich Eckhardt May 30 '21 at 21:01
  • @UlrichEckhardt It doesn't matter how Docker is implemented, it only matters what OS is in the image. [AWS Lambda images for Python](https://gallery.ecr.aws/lambda/python) run on Linux so any Linux solution should do, – phd May 30 '21 at 21:52

1 Answers1

0

A workaround for my problem is to use opencv-python-headless headless instead.

spadel
  • 998
  • 2
  • 16
  • 40