karalabe / xgo

Go CGO cross compiler
MIT License
2.14k stars 279 forks source link

Error "invalid mode: /build" on Windows 7 #106

Open kgolding opened 6 years ago

kgolding commented 6 years ago

Have installed docker toolbox on Wndows 7 64bit Pro, whichs run "docker run hello-world" ok, but am getting an error trying to use xgo:

Checking docker installation...
Client:
 Version:       18.02.0-ce
 API version:   1.35 (downgraded from 1.36)
 Go version:    go1.9.4
 Git commit:    fc4de447b5
 Built: Mon Feb 12 19:03:38 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6
  Built:        Tue Feb 27 22:20:43 2018
  OS/Arch:      linux/amd64
  Experimental: false

Checking for required docker image karalabe/xgo-latest... found.
Cross compiling domain.co.uk/_tests/walktest...
docker: Error response from daemon: invalid mode: /build.
See 'docker run --help'.
2018/03/09 00:08:08 Failed to cross compile package: exit status 125.
elad-da commented 6 years ago

I have the same issue on windows 10.


Client:
 Version:       18.03.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    0520e24302
 Built: Fri Mar 23 08:31:36 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.03.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   0520e24
  Built:        Wed Mar 21 23:14:54 2018
  OS/Arch:      linux/amd64
  Experimental: false

Checking for required docker image karalabe/xgo-latest... found.
Cross compiling github.com/project-iris/iris...
docker: Error response from daemon: invalid mode: /build.
See 'docker run --help'.
2018/04/02 14:43:43 Failed to cross compile package: exit status 125.
bcvery1 commented 6 years ago

I believe this caused by docker-toolbox not liking colons in '-v' cli options. This is called in the function 'compile' in 'xgo.go' line 233.

This example command causes the 'Error response from daemon: invalid mode: /build.' error:

docker run --rm -v c:\users:/build alpine ls

This example command does not (and works as expected):

docker run --rm -v /c/users:/build alpine ls