isce-framework / dolphin

InSAR phase linking library for PS/DS processing
https://dolphin-insar.readthedocs.io
Other
59 stars 17 forks source link

Problem installing with docker #406

Closed McWhity closed 2 weeks ago

McWhity commented 3 weeks ago

@openjournals/joss-reviews#6997

I tried to install dolphin via dockerfile https://github.com/isce-framework/dolphin/blob/main/docker/Dockerfile

First issue I encounter was

------
 > [stage-1 16/21] COPY --chown=mamba:mamba docker/specfile.txt /tmp/specfile.txt:
------
Dockerfile:64
--------------------
  62 |     # Install conda packages
  63 |     # https://github.com/mamba-org/micromamba-docker#quick-start
  64 | >>> COPY --chown=$MAMBA_USER:$MAMBA_USER docker/specfile.txt /tmp/specfile.txt
  65 |     RUN micromamba install --yes --channel conda-forge -n base -f /tmp/specfile.txt && \
  66 |         micromamba clean --all --yes
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 61b26c04-97a4-4cc6-b5ed-2b0c9ae5aa6f::z8vhf3w2wtwbn1cubgsq1rro6: "/docker/specfile.txt": not found

it seems to be an issue with the current directory

I change line 64 from COPY --chown=$MAMBA_USER:$MAMBA_USER docker/specfile.txt /tmp/specfile.txt to COPY --chown=$MAMBA_USER:$MAMBA_USER specfile.txt /tmp/specfile.txt which resolved the issue

McWhity commented 3 weeks ago

Another error that I get is

------
 > [stage-1 20/21] RUN python -m pip install --no-deps .:
1.114 ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
------
Dockerfile:81
--------------------
  79 |     
  80 |     # --no-deps because they are installed with conda
  81 | >>> RUN python -m pip install --no-deps .
  82 |     
  83 |     # Run the entrypoint from the /work directory
--------------------
ERROR: failed to solve: process "/usr/local/bin/_dockerfile_shell.sh python -m pip install --no-deps ." did not complete successfully: exit code: 1

Again it seems to be an error regarding the directory. I tried to hardcode the path but that did not resolve the error.

scottstanie commented 3 weeks ago

Hi @McWhity , How were you trying to build it? I've included the script ./docker/build-docker-image.sh to help with a few common options we do, though the base command is

docker build --network=host --tag $image_name --file docker/Dockerfile

E.g.:

$ ./docker/build-docker-image.sh
docker build --network=host --tag isce-framework/dolphin:latest --file docker/Dockerfile .
[+] Building 23.2s (22/27)
 => [internal] load build definition from Dockerfile                                                                                                                                                         0.0s
 => => transferring dockerfile: 74B                                                                                                                                                                          0.0s
....

Had you changed directories into the docker folder to build it?

McWhity commented 3 weeks ago

Hi @McWhity , How were you trying to build it? I've included the script ./docker/build-docker-image.sh to help with a few common options we do, though the base command is

Thank you for the hint. I tried the following command docker build docker/. which produces the error mentioned above. The error does not change if I am in the main directory or in the subfolder docker. If I use your build-docker-image.sh than everything works fine.

As you already prepared the relevant files for the docker creation I would recommend to add a short docker instruction guide to the Installation section.