Connect: permission denied


#1

I’m getting the following error when I’m trying to run in command line in “ordinary” user.

docker run -it --rm -v “$(pwd)/images:/code/images” -v “$(pwd)/odm_orthophoto:/code/odm_orthophoto” -v “$(pwd)/odm_texturing:/code/odm_texturing” opendronemap/opendronemap

/usr/bin/docker-current: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See ‘/usr/bin/docker-current run --help’.

When this same command is run as root I notice that it is trying find images from other location that is defined in command. images:/test/code/images" .

docker run -it --rm -v “$(pwd)/images:/test/code/images” -v “$(pwd)/odm_orthophoto:/code/odm_orthophoto” -v “$(pwd)/odm_texturing:/code/odm_texturing” opendronemap/opendronemap
[INFO] Initializing OpenDroneMap app - Fri Nov 02 07:19:56 2018
[INFO] Running ODM Load Dataset Cell
[INFO] Project directory /code/images doesn’t exist. Creating it now.
[DEBUG] /code/images
[DEBUG] Loading dataset from: /code/images
[DEBUG] /code/images
[ERROR] Not enough supported images in /code/images
[INFO] OpenDroneMap app finished - Fri Nov 02 07:19:56 2018


If command is run in root with correct path in command

docker run -it --rm -v “$(pwd)/images:/code/images” -v “$(pwd)/odm_orthophoto:/code/odm_orthophoto” -v “$(pwd)/odm_texturing:/code/odm_texturing” opendronemap/opendronemap
[INFO] Initializing OpenDroneMap app - Fri Nov 02 08:35:34 2018
[INFO] Running ODM Load Dataset Cell
[DEBUG] Loading dataset from: /code/images
[DEBUG] /code/images
Traceback (most recent call last):
File “/code/run.py”, line 47, in
plasm.execute(niter=1)
File “/code/scripts/dataset.py”, line 66, in process
files = get_images(images_dir)
File “/code/scripts/dataset.py”, line 43, in get_images
return [f for f in io.get_files_list(in_dir) if supported_extension(f)]
File “/code/opendm/io.py”, line 6, in get_files_list
return os.listdir(path_dir)
OSError: [Errno 13] Permission denied: '/code/images’

Have I misunderstand something?


#2

You need your user to be in the docker group, then run as that user.


#3

sudo usermod -aG docker ${USER}
then
su - ${USER}