question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dockerfile not build as expected

See original GitHub issue

I ran docker build in the latest clone of the repo. End with following error:

Step 11/12 : WORKDIR /mmdetection
 ---> Running in fee857c17c7e
Removing intermediate container fee857c17c7e
 ---> 211439ced91e
Step 12/12 : RUN pip install --no-cache-dir -e .
 ---> Running in dfb528eaf869
Obtaining file:///mmdetection
    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/mmdetection/setup.py'"'"'; __file__='"'"'/mmdetection/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /mmdetection/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/mmdetection/setup.py", line 171, in <module>
        sources=['src/compiling_info.cpp']),
      File "/mmdetection/setup.py", line 101, in make_cuda_ext
        raise EnvironmentError('CUDA is required to compile MMDetection!')
    OSError: CUDA is required to compile MMDetection!
    No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The command '/bin/sh -c pip install --no-cache-dir -e .' returned a non-zero code: 1

I have checked the pytorch image downloaded do have cuda installed under /usr/local/cuda.

root@b89786ddf1f5:/workspace# ls -l /usr/local/cuda
lrwxrwxrwx 1 root root 9 Aug 26 21:27 /usr/local/cuda -> cuda-10.1
root@b89786ddf1f5:/workspace# ls -l /usr/local/cuda-10.1
total 48
-rw-r--r-- 1 root root  366 Aug  9 19:57 LICENSE
-rw-r--r-- 1 root root  366 Aug  9 19:57 README
drwxr-xr-x 3 root root 4096 Aug 26 21:30 bin
drwxr-xr-x 2 root root 4096 Aug 26 21:27 compat
drwxr-xr-x 2 root root 4096 Aug 26 21:27 doc
drwxr-xr-x 5 root root 4096 Aug 26 21:30 extras
lrwxrwxrwx 1 root root   28 Aug  9 19:58 include -> targets/x86_64-linux/include
lrwxrwxrwx 1 root root   24 Aug  9 19:58 lib64 -> targets/x86_64-linux/lib
drwxr-xr-x 3 root root 4096 Aug 26 21:31 nvml
drwxr-xr-x 7 root root 4096 Aug 26 21:30 nvvm
drwxr-xr-x 3 root root 4096 Aug 26 21:30 share
drwxr-xr-x 2 root root 4096 Aug 26 21:30 src
drwxr-xr-x 1 root root 4096 Aug 26 21:27 targets
-rw-r--r-- 1 root root   22 Aug  9 19:57 version.txt

Any idea why the docker file does not build as expect. Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ldenoyelcommented, Feb 4, 2020

There is a bug in the recents changes that causes the issue. When I use an older version of mmdetection it works fine. In the Docker file I use : … WORKDIR /mmdetection RUN git reset --hard b7894cb RUN pip install --no-cache-dir -e . …

I am doing a hard reset to this commit, randomly taken, but I did not investigate which commit is responsible for this.

1reaction
prateek-77commented, Feb 3, 2020

I was meeting with the same issue. I used the image nvcr.io/nvidia/pytorch:xx from nvcr page. I ran a container using this image, and set the flag –runtime = nvidia (For identifying CUDA). Then run and attach with the container and follow the steps given in install.md. The model works perfectly fine on docker after this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FROM...AS in Dockerfile not working as I expect - Stack Overflow
I want to make a docker image that builds on top of another docker image I have already built. In my dockerfile, I...
Read more >
docker build - Docker Documentation
docker build returns a no such file or directory error if the file or directory does not exist in the uploaded context. This...
Read more >
Docker: “build” Requires 1 Argument Error - Baeldung
The most common reason for “Docker build Requires 1 Argument” error is when we try to build the image without providing sufficient arguments....
Read more >
Reduce Docker container build warnings - Visual Studio Code
This occurs in Dockerfiles because the apt-key command is not running from a terminal. Unfortunately, this error cannot be eliminated completely, but can...
Read more >
Building your Docker Image - Runnable
Check the FROM instruction in your Dockerfile. The base image name is correct, but the image tag (specified after the colon) does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found