I'm building a script to automate Instagram marketing and are using the instagrapi
library. This script (login.py
) logs in:
from instagrapi import Client
cl = Client()
cl.login(username,password)
It works fine when running it locally (fill in your own username
and password
).
However, once I run it in a docker container, it gives me a Segmentation fault
. Any idea why this happens?
Dockerfile
:
FROM python:3.8-slim-buster
RUN python -m pip install instagrapi
RUN python -m pip install Pillow
RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone
ENTRYPOINT ["tail", "-f", "/dev/null"]
To reproduce the error, add Dockerfile
and login.py
to a folder, open terminal and navigate to the folder, build the image via docker build -t instagram:v1.0 .
and run it via docker run instagram:v1.0
. Then open another terminal, find the container id (docker ps -a
) and enter the container docker exec -it 'containerid' bash
. Then run python login.py
in the container.
I read somewhere that this error may be due to some underlying C code. Could it be that the Dockerfile
is missing some dependencies?
Local env: python3.8, Mac M1 pro