Odm: [Windows] docker: invalid reference format

Created on 29 May 2017  路  17Comments  路  Source: OpenDroneMap/ODM

After having problems running ODM with the vagrant variant, I thought I'd give docker a try. Unfortunately I have following problem which I cannot solve:

foo@bar MINGW64 /c/workspace/bellus
$ winpty docker run -it --rm -v $(pwd)/images:/code/images -v $(pwd)/odm_orthophoto:/code/odm_orthophoto -v $(pwd)/odm_georeferencing:/code/odm_georeferencing opendronemap/opendronemap --meshing-size 100000
docker: invalid reference format.
See 'docker run --help'.


Additional Information

foo@bar MINGW64 /c/workspace/bellus
$ echo $(pwd)
/c/workspace/bellus

foo@bar MINGW64 /c/workspace/bellus
$ ls -al
total 6
drwxr-xr-x 1 foo 1049089 0 May 29 14:13 ./
drwxr-xr-x 1 foo 1049089 0 May 29 14:21 ../
-rw-r--r-- 1 foo 1049089 17 May 7 2016 .gitignore
-rw-r--r-- 1 foo 1049089 321 May 7 2016 gcp_list.txt
drwxr-xr-x 1 foo 1049089 0 May 29 14:13 images/

$ docker version
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Fri May 5 15:36:11 2017
OS/Arch: windows/amd64

Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Thu May 4 21:43:09 2017
OS/Arch: linux/amd64
Experimental: false

$ docker info
Containers: 14
Running: 0
Paused: 0
Stopped: 14
Images: 2
Server Version: 17.05.0-ce
Storage Driver: aufs
Root Dir: /mnt/sda1/var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 70
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.4.66-boot2docker
Operating System: Boot2Docker 17.05.0-ce (TCL 7.2); HEAD : 5ed2840 - Fri May 5 21:04:09 UTC 2017
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.858GiB
Name: default
ID: JBPW:BABW:64NT:4PSX:Y6K6:BAT5:K3ZT:34GS:N62P:EKSL:J5I5:K63S
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 16
Goroutines: 22
System Time: 2017-05-29T14:31:44.339328435Z
EventsListeners: 0
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Can anyone help please?

Most helpful comment

@AZOM
@smathermather

If you want to reference a variable (such as calling your pwd) to mount the local fs.. In powershell you'll want to use ${pwd} vs $(pwd).. I'm putting this out there just in case anyone else stumbles across this thread.

docker run -v ${pwd}:/app/ -w /app/ -i -t hashicorp/terraform:light --version

All 17 comments

In windows is and not / to folders.
Eg. docker run -it --rm -v C:\Users\Usuario\git\odm_data_seneca\images:/code/images opendronemap/opendronemap

@patrickelectric Unfortunately that has still the same result:
winpty docker run -it --rm -v C:\\workspace\\bellus\\images:/code/images -v C:\\workspace\\bellus\\odm_orthophoto:/code/odm_orthophoto -v C:\\workspace\\bellus\\odm_georeferencing:/code/odm_georeferencing opendronemap/opendronemap --meshing-size 100000

results in:

docker: invalid reference format.
See 'docker run --help'.

And I have to use \\ double-backspace because if you only do one it is recognized as escaping and the path is wrong. I tested with ls and that works without issues.

What is winpty? is that potentially affecting the docker command?

@dakotabenjamin This an additional command you need to use when operating under Windows to get a bash shell like response from whatever you are executing afterwards (e.g. docker). See https://github.com/rprichard/winpty

@AZOM Please tell me the final solution. THX.

@Icemap @AZOM try wrapping with double quotes and adding a forward slash "/$(pwd)"
winpty docker run -it --rm -v "/$(pwd)"/images:/code/images -v "/$(pwd)"/odm_orthophoto:/code/odm_orthophoto -v "/$(pwd)"/odm_georeferencing:/code/odm_georeferencing opendronemap/opendronemap --meshing-size 100000

@Icemap I was having this issue (not with the same project in this repo, but a different docker container) and the suggestion made by @tuxrace didn't work, but I've managed to solve this by replacing the backslashes with forward slashes in the windows path.

So instead of
docker run -it --rm -v D:\Users\irozgar\Documents\LearningDocker\php-app:/opt -w /opt --network=phpapp_appnet shippingdocker/php ls
I used
docker run -it --rm -v D:/Users/irozgar/Documents/LearningDocker/php-app:/opt -w /opt --network=phpapp_appnet shippingdocker/php ls

I am still having this same problem with docker on window

docker run -it -v C:/Users/rburton/code/Docker/R:/home/docker -w /home/docker -u docker --rm /usr/bin/bash

... docker.exe: invalid reference format.

Server Version: 17.09.0-ce

It should work after changing path to lowercase

docker run -it -v "C:/Users/rburton/code/Docker/R:/home/docker".ToLower() -w /home/docker -u docker --rm /usr/bin/bash

Also note that if you have spaces in your folder name this error occurs

@irozgar 's answer worked for me. I was using $(pwd):/app in my volumes declaration, which is the present working directory with Windows backslashes included. Explicitly typing the path fixed the issue.

e.g. -v C:yourappdirectory:/app

Hope this helps others

@AZOM
@smathermather

If you want to reference a variable (such as calling your pwd) to mount the local fs.. In powershell you'll want to use ${pwd} vs $(pwd).. I'm putting this out there just in case anyone else stumbles across this thread.

docker run -v ${pwd}:/app/ -w /app/ -i -t hashicorp/terraform:light --version

I just stumbled across this thread and was super happy to find the solution.

putting the pwd variable and target path both in double quotes worked for me in powershell since I had whitespace in the source path. No slash replacement nor lower case conversion needed.
-v "${pwd}:/data"

I just put double quotes around the "host_path:container_path".
It worked for me in powershell.

docker container run -p 8080:80 -v //D/Dev/volume:/usr/share/nginx/html nginx

@AZOM
@smathermather

If you want to reference a variable (such as calling your pwd) to mount the local fs.. In powershell you'll want to use ${pwd} vs $(pwd).. I'm putting this out there just in case anyone else stumbles across this thread.

docker run -v ${pwd}:/app/ -w /app/ -i -t hashicorp/terraform:light --version

It's worked
docker run -it --rm --name myphp -v ${pwd}:/usr/src/myapp -w /usr/src/myapp php:7.4-cli php index.php
(the reference given on docker hub : https://hub.docker.com/_/php

Thanks! @BenMitchell1979

Was this page helpful?
0 / 5 - 0 ratings