Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Docker causes error #2271

Open
rowild opened this issue Dec 9, 2023 · 2 comments
Open

Building Docker causes error #2271

rowild opened this issue Dec 9, 2023 · 2 comments

Comments

@rowild
Copy link

rowild commented Dec 9, 2023

I run docker build . -t openmvg, but it always throws an error:

➜  openMVG-2.0 docker build . -t openmvg
[+] Building 2.3s (8/10)                                                                          docker:desktop-linux
 => [internal] load .dockerignore                                                                                 0.0s
 => => transferring context: 2B                                                                                   0.0s
 => [internal] load build definition from Dockerfile                                                              0.0s
 => => transferring dockerfile: 1.15kB                                                                            0.0s
 => [internal] load metadata for docker.io/library/ubuntu:bionic                                                  2.1s
 => [1/6] FROM docker.io/library/ubuntu:bionic@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2  0.0s
 => [internal] load build context                                                                                 0.1s
 => => transferring context: 195.67kB                                                                             0.1s
 => CACHED [2/6] RUN apt-get update && apt-get install -y   cmake   build-essential   graphviz   git   coinor-li  0.0s
 => CACHED [3/6] ADD . /opt/openMVG                                                                               0.0s
 => ERROR [4/6] RUN cd /opt/openMVG && git submodule update --init --recursive                                    0.1s
------                                                                                                                 
 > [4/6] RUN cd /opt/openMVG && git submodule update --init --recursive:
0.089 fatal: not a git repository (or any of the parent directories): .git
------
Dockerfile:25
--------------------
  23 |     # Clone the openvMVG repo
  24 |     ADD . /opt/openMVG
  25 | >>> RUN cd /opt/openMVG && git submodule update --init --recursive
  26 |     
  27 |     # Build
--------------------
ERROR: failed to solve: process "/bin/sh -c cd /opt/openMVG && git submodule update --init --recursive" did not complete successfully: exit code: 128

It seems Docker is again cloning the openMVG repo into /opt/openMVG – why? It is already cloned.
What can I do to get rid of this error?

I am on a Macbook Pro M2, macOS 13.6

@pmoulon
Copy link
Member

pmoulon commented Dec 9, 2023

Can you share in which folder are you?
You should run this in a git clone

@rowild
Copy link
Author

rowild commented Dec 9, 2023

Thank you, @pmoulon , for your quick responses! Very much appreciated!

So from what I understand from your previous comment I should first git clone --recursive [the-repo]--recursive being the keyword here. Because previously I did NOT use --recursive.

OK. I ran git clone --recursive [repo] and then changed into that openMVG folder in order to runt he Docker command.
However, I still get an error, which you can see in the attached text file.

What I am still wondering about is: why does the docker solution try to install something into the local /opt folder? It is a Docker app and IMO shouldn't do that. (BTW: It does not, and that seems to be the reason why the error happens; I have a feeling that I should run the command as sudo – but, honestly, I do not want Docker to install anything outside of its container.)

openmvg_docker_setup_error.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants