Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker.exe: invalid reference format

I don't understand what's the problem ?

I installed Docker on Win10. This is my first experience with it. I read the manuals, start hello-world, and more. Next, I need to use the command mvn compile in the folder of the repository. For this needed to install Mavin.

I see this: https://hub.docker.com/_/maven/ and used:

docker run -it --rm --name my-maven-project -v "$PWD":/usr/src/mymaven -w /usr/src/mymaven maven:3.2-jdk-7 mvn clean install

... and I get the output

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: invalid reference format.
See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

Output docker version

Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:09 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:45:38 2017
 OS/Arch:      linux/amd64
 Experimental: true

Output docker info

Containers: 4
 Running: 0
 Paused: 0
 Stopped: 4
Images: 3
Server Version: 17.09.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.49-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: moby
ID: O3WT:CHTU:34YG:IYV3:OELC:RSAW:WSYD:E3HV:2ZUO:DWBU:JXOB:EN4Y
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 16
 Goroutines: 26
 System Time: 2017-10-25T18:44:10.1162161Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Sorry for the stupid question, first time working with Docker... Thanks!

like image 338
Иван Пузырёв Avatar asked Oct 25 '17 19:10

Иван Пузырёв


2 Answers

You need to use the right syntax for the current folder, in the right environment:

  • in a simple CMD shell session, you would use:

    -v "%cd%":/usr/src/mymaven
    
  • in a Powershell session

    -v ${PWD}:/usr/src/mymaven
    
like image 105
VonC Avatar answered Oct 02 '22 19:10

VonC


I had a situation: the dash was Unicode dash not ASCII minus (need to retype the dashes)

‐   8208    2010        HYPHEN
‑   8209    2011        NON-BREAKING HYPHEN
‒   8210    2012        FIGURE DASH
–   8211    2013    – EN DASH
—   8212    2014    — EM DASH
―   8213    2015        HORIZONTAL BAR
like image 23
Shimon Doodkin Avatar answered Oct 02 '22 19:10

Shimon Doodkin