Closed BenjaminLAZARD closed 5 years ago
You shouldn't run docker_build.py with sudo. I think that is the problem. The readme contains instructions on how to run docker without sudo priveleges
Thank you for your quick reply. Of course I did start by following exactly the instructions of the readme. The only difference is the sudo
. Without it, I get the following error.
building docker container . . .
building docker image named benj-pytorch-dense-correspondence
command =
docker build --build-arg USER_NAME=benj --build-arg USER_PASSWORD=password --build-arg USER_ID=1000 --build-arg USER_GID=1000 -t benj-pytorch-dense-correspondence -f pytorch-dense-correspondence.dockerfile .
executing shell command
Sending build context to Docker daemon 17.92kB
Step 1/25 : FROM nvidia/cuda:8.0-devel-ubuntu16.04
---> ed7c1b380cab
Step 2/25 : ARG USER_NAME
---> Using cache
---> f6a706272afb
Step 3/25 : ARG USER_PASSWORD
---> Using cache
---> ddd86243972d
Step 4/25 : ARG USER_ID
---> Using cache
---> 594b23ecd76e
Step 5/25 : ARG USER_GID
---> Using cache
---> 6f1c470e7d07
Step 6/25 : RUN usermod -aG sudo $USER_NAME
---> Running in f3f8045d4d3f
usermod: user 'benj' does not exist
The command '/bin/sh -c usermod -aG sudo $USER_NAME' returned a non-zero code: 6
Hi Benj --
What if you run these following commands in the terminal? First run whoami
and see what you get. Then open a python interpreter and call getpass.getuser()
. Here's the example for me below. What do you get?
peteflo@peteflo-m2:~$ whoami
peteflo
peteflo@peteflo-m2:~$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import getpass
>>> getpass.getuser()
'peteflo'
Also for context we've used this docker build configuration on dozens on different computers with lots of different configurations. I imagine we can get yours to work just fine.
Thank you! Both commands return my username, "benj".
I have run through the entire tutorial in #196 and didn't encounter this issue. You may want to try again once that PR lands and see if you still have problems.
Hello,
When running
sudo ./docker_build.py
apt-get seem to be unable to access channels from the script. I already configured docker so that it could go through a proxy, and
docker run hello-world
runs without problems.