Invalid reference format docker while setting up development environment


#1

Hi,
I was trying to build the development environment for the Moby project on Github following these instructions https://github.com/moby/moby/blob/231a4408f2d691838e4f821eedb7439c4e1b3f56/docs/contributing/set-up-dev-env.md
However, when I was in the task 2.4 to build a development environment image and run it in a container, I’ve encountered this error rather than a successful message

docker run --rm -i --privileged  -e DOCKER_CROSSPLATFORMS -e BUILD_APT_MIRROR -e BUILDFLAGS -e KEEPBUNDLE -e DOCKER_BUILD_ARGS -e DOCKER_BUILD_GOGC -e DOCKER_BUILD_PKGS -e DOCKER_BASH_COMPLETION_PATH -e DOCKER_CLI_PATH -e DOCKER_DEBUG -e DOCKER_EXPERIMENTAL -e DOCKER_GITCOMMIT -e DOCKER_GRAPHDRIVER -e DOCKER_INCREMENTAL_BINARY -e DOCKER_LDFLAGS -e DOCKER_PORT -e DOCKER_REMAP_ROOT -e DOCKER_STORAGE_OPTS -e DOCKER_USERLANDPROXY -e TEST_INTEGRATION_DIR -e TESTDIRS -e TESTFLAGS -e TIMEOUT -e HTTP_PROXY -e HTTPS_PROXY -e NO_PROXY -e http_proxy -e https_proxy -e no_proxy -e VERSION -e PLATFORM -v "/Users/namnguyen/Self-taught/Open source/moby-fork/.:/go/src/github.com/docker/docker/." -v /Users/namnguyen/Self-taught/Open source/moby-fork/.git:/go/src/github.com/docker/docker/.git -v "dockerdev-go-pkg-cache-gopath:/go/pkg" -v "dockerdev-go-pkg-cache-goroot-linux_amd64:/usr/local/go/pkg/linux_amd64" -v "dockerdev-go-pkg-cache-goroot-linux_amd64_netgo:/usr/local/go/pkg/linux_amd64_netgo"    -t "docker-dev:dry-run-test" bash

docker: invalid reference format.
See ‘docker run --help’.
make: *** [shell] Error 125

I am using Mac OSX, and my docker version is 17.12.0-ce

Has anyone ever experienced something similar and can guide me through it? Thanks

Nam


#2

I believe the issue is that you have a space in your path, and you haven’t double-quoted one of the bind-mount options, so docker run thinks you’re trying to run an image named source/moby-fork/.git:/go/src/github.com/docker/docker/.git (which is obviously not what you wanted!)