0
votes

I'm getting an "invalid reference format" error when trying to run a docker container on Windows using the below syntax, following the below guide.

https://www.jenkins.io/doc/tutorials/build-a-multibranch-pipeline-project/

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

docker container run --name jenkins-docker --rm --detach ^

--privileged --network jenkins --network-alias docker ^

--env DOCKER_TLS_CERTDIR=/certs ^

--volume jenkins-docker-certs:/certs/client ^

--volume jenkins-data:/var/jenkins_home ^

--volume "%HOMEDRIVE%%HOMEPATH%":/home ^

docker:dind

I've also tried running it as one big long command (below) and get the same error?

docker container run --name jenkins-docker --rm --detach --privileged --network jenkins --network-alias docker --env DOCKER_TLS_CERTDIR=/certs --volume jenkins-docker-certs:/certs/client --volume jenkins-data:/var/jenkins_home --volume "%HOMEDRIVE%%HOMEPATH%":/home docker:dind

Can anyone point me in the right direction?

Thanks in advance :-)

Greg

1
What docker version you have? Did you succeed with volume creation? What you get when you list volumes: docker volume lsGintsGints
Check that all your spaces are really spaces and dashes are really dashes. If you copied them from somewhere instead of typing them, type them explicitly.BMitch
Hey GintsGints, Docker version is 19.03.5, build 633a0ea838. And yes, volumes created fine, as did the bridge network creation...greghaines

1 Answers

0
votes

I had a similar problem. also when I copied from the tutorial. you need to remove the characters "^" and try to enter in one line. also check for the presence of all "--"