Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32861

Checking Dockerfile in project doesn't work with Slave

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In docker-custom-build-environnment-plugin 1.6.5-SNAPSHOT, I have this issue :
      Your project is missing a Dockerfile

      But I haven' in 1.6.4 release version.

      In fact this is due to this PR : https://github.com/jenkinsci/docker-custom-build-environment-plugin/pull/37
      I have tested without, and it's works.

      I think that the test is too early in the process, maybe only with slave? Or only with gerrit-trigger-plugin? Or maybe the control will not be the same at this place?

      I will continue my test and maybe propose a new PR to fix this.

        Attachments

          Activity

          Hide
          aheritier Arnaud Héritier added a comment -

          Fixed in 1.6.5

          Show
          aheritier Arnaud Héritier added a comment - Fixed in 1.6.5
          Hide
          tcollignon Thomas Collignon added a comment -

          Seem to be good in 1.6.5 for us.

          You can close this issue if you want.
          Thanks you for your quick release

          Show
          tcollignon Thomas Collignon added a comment - Seem to be good in 1.6.5 for us. You can close this issue if you want. Thanks you for your quick release
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Nicolas De loof
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerfileImageSelector.java
          http://jenkins-ci.org/commit/docker-custom-build-environment-plugin/e3b8b5c2d48dc6fefbb3c7097563809d9e1dbe44
          Log:
          Merge pull request #43 from jenkinsci/fix/JENKINS-32861

          fix JENKINS-32861: --build option must pass an absolute path to the DockerFile

          Compare: https://github.com/jenkinsci/docker-custom-build-environment-plugin/compare/58c931ef3dfc...e3b8b5c2d48d

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De loof Path: src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerfileImageSelector.java http://jenkins-ci.org/commit/docker-custom-build-environment-plugin/e3b8b5c2d48dc6fefbb3c7097563809d9e1dbe44 Log: Merge pull request #43 from jenkinsci/fix/ JENKINS-32861 fix JENKINS-32861 : --build option must pass an absolute path to the DockerFile Compare: https://github.com/jenkinsci/docker-custom-build-environment-plugin/compare/58c931ef3dfc...e3b8b5c2d48d
          Hide
          aheritier Arnaud Héritier added a comment -

          It seems that it doesn't work in all cases.
          --file option of docker build must be an absolute path
          Otherwise you have this error :

          Build Docker image from ./spring-petclinic//Dockerfile ...
          $ docker build --file Dockerfile /Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/jenkins-home/jobs/zd-33463/workspace/spring-petclinic
          unable to prepare context: The Dockerfile (/Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/Dockerfile) must be within the build context (/Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/jenkins-home/jobs/zd-33463/workspace/spring-petclinic)
          FATAL: Failed to build docker image from project Dockerfile
          

          The message is misleading because it says that /Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/Dockerfile isn't under /Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/jenkins-home/jobs/zd-33463/workspace/spring-petclinic but in docker command line we have --file Dockerfile. --file must be an absolute path.

          Here is the PR: https://github.com/jenkinsci/docker-custom-build-environment-plugin/pull/43

          Show
          aheritier Arnaud Héritier added a comment - It seems that it doesn't work in all cases. --file option of docker build must be an absolute path Otherwise you have this error : Build Docker image from ./spring-petclinic //Dockerfile ... $ docker build --file Dockerfile /Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/jenkins-home/jobs/zd-33463/workspace/spring-petclinic unable to prepare context: The Dockerfile (/Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/Dockerfile) must be within the build context (/Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/jenkins-home/jobs/zd-33463/workspace/spring-petclinic) FATAL: Failed to build docker image from project Dockerfile The message is misleading because it says that /Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/Dockerfile isn't under /Users/arnaud/CloudBees/Support/cases/33463/3-cloudbees-support_2016-02-16_15.20.59_UsineValidation/jenkins-home/jobs/zd-33463/workspace/spring-petclinic but in docker command line we have --file Dockerfile. --file must be an absolute path. Here is the PR: https://github.com/jenkinsci/docker-custom-build-environment-plugin/pull/43
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Arnaud Héritier
          Path:
          src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerfileImageSelector.java
          http://jenkins-ci.org/commit/docker-custom-build-environment-plugin/dbf2e19f60b7802373972e64a1471a887b260087
          Log:
          fix JENKINS-32861: --build option must pass an absolute path to the DockerFile

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Arnaud Héritier Path: src/main/java/com/cloudbees/jenkins/plugins/docker_build_env/DockerfileImageSelector.java http://jenkins-ci.org/commit/docker-custom-build-environment-plugin/dbf2e19f60b7802373972e64a1471a887b260087 Log: fix JENKINS-32861 : --build option must pass an absolute path to the DockerFile

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              tcollignon Thomas Collignon
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: