Docker image Error — The Docker image build failed

Hi,

The Docker image build failed systematically when I tried to start a new interactive environment (see screenshot). Ignoring this requires pip installation of all requirements.

Project: shin.koseki/cdh_map

1 Like

Hi Shin,
could you click the ‘view pipeline in GitLab’ button and tell us what error you see there?
Andreas

Hi Andreas, thanks:

 ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python /opt/conda/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpjtpotx7n
       cwd: /tmp/pip-install-jjh7y_3e/cartopy
  Complete output (3 lines):
  setup.py:171: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail.
    '.'.join(str(v) for v in GEOS_MIN_VERSION), ))
  Proj 4.9.0 must be installed.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/conda/bin/python /opt/conda/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpjtpotx7n Check the logs for full command output.
The command '/bin/sh -c conda env update -q -f /tmp/environment.yml &&     /opt/conda/bin/pip install -r /tmp/requirements.txt &&     conda clean -y --all &&     conda env export -n "root"' returned a non-zero code: 1
ERROR: Job failed: exit code 1

Hi @sjinko,

Thanks for the snapshots!

Some packages require some extra system dependencies that you can add in the Dockerfile of your project. I tried with your specific error of cartopy, which seems to need to apt-get install the ones from here: https://stackoverflow.com/questions/53697814/using-pip-install-to-install-cartopy-but-missing-proj-version-at-least-4-9-0

libproj-dev
proj-data
proj-bin  
libgeos-dev  

There’s a commented out section in the Dockerfile that shows where to add them, but you can also look at my example here:

https://renkulab.io/projects/emma.jablonski/latest-python-test/files/blob/Dockerfile
these lines:

USER root
RUN apt-get update && \
   apt-get install -y --no-install-recommends \
   libproj-dev proj-data proj-bin  \
   libgeos-dev 
USER ${NB_USER}

Since the docker image build failed, you can make the edits to the Dockerfile in the GitLab editing interface.

To make sure the requirements will build when you start a new environment, you can try pip install -r requirements.txt. Otherwise using the GitLab editor for updating the Dockerfile is a good way to test changes if your docker image isn’t building.

Thanks,
Emma

2 Likes

Hi Emmjab,
Thanks for this. It seems to work!

best,

Shin