'Running a python docker with miniconda3 and geopandas

I create a docker to run a python script with data inputs as arguments. Sounds straighforward, I proceed by

(1) Create the library image

Dockerfile_libraries:

FROM continuumio/miniconda3
RUN conda config --add channels conda-forge && conda update -y conda \
&& conda install -y geopandas

docker build -t img1 -f Dockerfile_libraries .

(2) Add the code and the data

Dockerfile_analysis:

FROM img1 
RUN mkdir -p /home/
COPY /data/ /home/data/
COPY myScript.py /home/
ENTRYPOINT ["python", "/home/myScript.py", "/home/data/data1", "/home/data/data2"]

docker build -t img2 -f Dockerfile_analysis .

(3) Run it:

docker run img2

But then it says

ERROR 1: PROJ: proj_create_from_database: Open of /opt/conda/share/proj failed

and I stop it with a ctrl-c



Solution 1:[1]

I have the same problem and I think this issue is related to this question. According to that post, the problem is related to the use of pyproj in the base environment. Unfortunately, the proposed solution does not generalize well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Raphael