Docker error "working directory is invalid"

30 views
Skip to first unread message

Ralph Connors

unread,
Jan 2, 2020, 11:14:24 AM1/2/20
to Jenkins Users
I am working through the Maven/Java Jenkins tutorial.

I was able work up to running the Pipeline, but the following fails:

docker run -d -t -v /root/.m2:/root/.m2 -w C:/Users/ralph.connors/.jenkins/workspace/simple-java-maven-app/ -v C:/Users/ralph.connors/.jenkins/workspace/simple-java-maven-app/:C:/Users/ralph.connors/.jenkins/workspace/simple-java-maven-app/ -v C:/Users/ralph.connors/.jenkins/workspace/simple-java-maven-app@tmp/:C:/Users/ralph.connors/.jenkins/workspace/simple-java-maven-app@tmp/ -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** maven:3-alpine cmd.exe

[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: Failed to run image 'maven:3-alpine'. Error: docker: Error response from daemon: the working directory 'C:/Users/ralph.connors/.jenkins/workspace/simple-java-maven-app/' is invalid, it needs to be an absolute path.
See 'docker run --help'.
	at org.jenkinsci.plugins.docker.workflow.client.WindowsDockerClient.run(WindowsDockerClient.java:57)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:199)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:286)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
        ...

Slide

unread,
Jan 2, 2020, 11:19:51 AM1/2/20
to Jenkins User Mailing List
Why are you using an Alpine Linux image with Windows paths? If you want to run a Linux container, you need to setup your volumes to use Linux paths mapped to the Windows equivalent (if you are running this on a Windows host).

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c9c89678-a100-4388-9595-fab157037fc5%40googlegroups.com.


--

Ralph Connors

unread,
Jan 2, 2020, 11:25:33 AM1/2/20
to jenkins...@googlegroups.com
Thanks for your quick answer. I am new to both Docker and Jenkins - how do I do this?

Slide

unread,
Jan 2, 2020, 12:38:48 PM1/2/20
to Jenkins User Mailing List
You will probably want to read up on volumes in Docker from the Docker documentation (https://docs.docker.com/storage/volumes/).



--
Reply all
Reply to author
Forward
0 new messages