[JIRA] (JENKINS-56488) Docker Pipeline plugin doesn't support quotes around Dockerfile path

2 views
Skip to first unread message

schogow@gmail.com (JIRA)

unread,
Mar 8, 2019, 1:56:02 PM3/8/19
to jenkinsc...@googlegroups.com
Aleksei Zhogov created an issue
 
Jenkins / Bug JENKINS-56488
Docker Pipeline plugin doesn't support quotes around Dockerfile path
Issue Type: Bug Bug
Assignee: Unassigned
Components: docker-workflow-plugin
Created: 2019-03-08 18:55
Environment: Jenkins 2.167
Both Docker Pipeline 1.17 and latest master (490870e)
Priority: Minor Minor
Reporter: Aleksei Zhogov

Pipeline:

node {
    sh 'echo "FROM alpine" > Dockerfile'
    sh 'ls'
    sh 'cat Dockerfile'
    docker.build("test-image", "--file './Dockerfile' .")
}

Error I get from Docker Pipeline 1.17

[Pipeline] Start of Pipeline (hide)
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/test-pipeline
[Pipeline] {
[Pipeline] sh
+ echo FROM alpine
[Pipeline] sh
+ ls
Dockerfile
[Pipeline] sh
+ cat Dockerfile
FROM alpine
[Pipeline] sh
+ docker build -t test-image --file ./Dockerfile .
Sending build context to Docker daemon  2.048kB

Step 1/1 : FROM alpine
 ---> caf27325b298
Successfully built caf27325b298
Successfully tagged test-image:latest
[Pipeline] dockerFingerprintFrom
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.nio.file.NoSuchFileException: /var/jenkins_home/workspace/test-pipeline/'./Dockerfile'
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
	at java.nio.file.Files.newInputStream(Files.java:152)
	at hudson.FilePath.read(FilePath.java:1940)
	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:100)
	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:85)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate(ACL.java:290)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

Error I get from Docker Pipeline latest master (490870e)

[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/test-pipeline
[Pipeline] {
[Pipeline] sh
+ echo FROM alpine
[Pipeline] sh
+ ls
Dockerfile
[Pipeline] sh
+ cat Dockerfile
FROM alpine
[Pipeline] sh
+ docker build -t test-image --file ./Dockerfile .
Sending build context to Docker daemon  2.048kB

Step 1/1 : FROM alpine
 ---> caf27325b298
Successfully built caf27325b298
Successfully tagged test-image:latest
[Pipeline] dockerFingerprintFrom
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.nio.file.NoSuchFileException: /var/jenkins_home/workspace/test-pipeline/'./Dockerfile'
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
	at java.nio.file.Files.newByteChannel(Files.java:361)
	at java.nio.file.Files.newByteChannel(Files.java:407)
	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
	at java.nio.file.Files.newInputStream(Files.java:152)
	at hudson.FilePath.read(FilePath.java:1940)
	at org.jenkinsci.plugins.docker.workflow.Dockerfile.parse(Dockerfile.java:62)
	at org.jenkinsci.plugins.docker.workflow.Dockerfile.<init>(Dockerfile.java:50)
	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:98)
	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:84)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
	at hudson.security.ACL.impersonate(ACL.java:290)
	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

schogow@gmail.com (JIRA)

unread,
Mar 8, 2019, 2:00:02 PM3/8/19
to jenkinsc...@googlegroups.com

schogow@gmail.com (JIRA)

unread,
Mar 8, 2019, 2:02:02 PM3/8/19
to jenkinsc...@googlegroups.com

schogow@gmail.com (JIRA)

unread,
Apr 24, 2019, 7:24:02 AM4/24/19
to jenkinsc...@googlegroups.com
Aleksei Zhogov assigned an issue to Unassigned

schogow@gmail.com (JIRA)

unread,
Apr 24, 2019, 7:27:02 AM4/24/19
to jenkinsc...@googlegroups.com
 
Re: Docker Pipeline plugin doesn't support quotes around Dockerfile path

Devin Nusbaum can you please take a look at this issue and PR.

I'm not sure what is the next step after creating an issue and PR to fix it.

dnusbaum@cloudbees.com (JIRA)

unread,
Apr 24, 2019, 9:43:02 AM4/24/19
to jenkinsc...@googlegroups.com

Aleksei Zhogov Is there any particular reason why you want to put quotes around your dockerfile name? I guess if the name contains spaces?

schogow@gmail.com (JIRA)

unread,
Apr 24, 2019, 10:08:03 AM4/24/19
to jenkinsc...@googlegroups.com

dnusbaum@cloudbees.com (JIRA)

unread,
Apr 24, 2019, 10:40:01 AM4/24/19
to jenkinsc...@googlegroups.com

dnusbaum@cloudbees.com (JIRA)

unread,
Apr 24, 2019, 10:40:02 AM4/24/19
to jenkinsc...@googlegroups.com
Devin Nusbaum started work on Bug JENKINS-56488
 
Change By: Devin Nusbaum
Status: Open In Progress

siraj.sherriff@oracle.com (JIRA)

unread,
Jul 16, 2019, 1:26:02 AM7/16/19
to jenkinsc...@googlegroups.com
Siraj Sherriff commented on Bug JENKINS-56488
 
Re: Docker Pipeline plugin doesn't support quotes around Dockerfile path

I am getting this same error in the following Jenkins version.

org.jenkins-ci.main:jenkins-war:2.176.1

My command is as follows and the Dockerfile is actually named "dockerfile" (lower case 'd')

app = docker.build('newimage_190715');

The docker.build() call is actually building the docker image, but at the end, it gives an error,

Successfully built a1b2c3d4e5
Successfully tagged newimage_190715:latest
[Pipeline] dockerFingerprintFrom
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.nio.file.NoSuchFileException: <path>/Dockerfile
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) 

To workaround the build failure, I created a symlink and the error disappeared.

 $ ls -ltr

lrwxrwxrwx 1 xxxxxxxx 1234   10 Jul 15 22:00 Dockerfile -> dockerfile

Is there a dependency on the exact filename that Jenkins expects at some point in the build steps ?

Reply all
Reply to author
Forward
0 new messages