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

Unable to build containers due to wrong "docker build" command

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      CentOS 6.7 64 bit
      Java 1.7.0_85
      Jenkins 1.642.2
      CloudBees Docker Build and Publish plugin 1.2
      Jenkins installed via YUM
    • Similar Issues:

      Description

      After upgrading docker-build-publish-plugin from version 1.0.1 to version 1.2, I get the following error when building containers:

      12:57:02 [build-container] $ docker build null -t <redacted> --pull=true /workspace/build-container
      12:57:02 docker: "build" requires 1 argument.
      12:57:02 See 'docker build --help'.
      12:57:02 
      12:57:02 Usage:	docker build [OPTIONS] PATH | URL | -
      12:57:02 
      12:57:02 Build an image from a Dockerfile
      12:57:02 Build step 'Docker Build and Publish' marked build as failure
      12:57:02 Notifying upstream projects of job completion
      12:57:02 [WS-CLEANUP] Deleting project workspace...[WS-CLEANUP] Skipped based on build state FAILURE
      12:57:02 Finished: FAILURE
      

      Downgrading to version 1.0.1 seems to fix it.

      At first glance this commit seems to be the cause, doesn't look like getBuildAdditionalArgs() is being properly sanitized: https://github.com/jenkinsci/docker-build-publish-plugin/commit/8327c28ec52b77c1ee20c65a69ef01f1e3ef3613

      Thank you

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Carlos Sanchez
          Path:
          src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java
          http://jenkins-ci.org/commit/docker-build-publish-plugin/0cbb39f60d9896884761dd9e4033c459ce549eee
          Log:
          JENKINS-33153 Ensure getBuildAdditionalArgs is not null

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Carlos Sanchez Path: src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java http://jenkins-ci.org/commit/docker-build-publish-plugin/0cbb39f60d9896884761dd9e4033c459ce549eee Log: JENKINS-33153 Ensure getBuildAdditionalArgs is not null

            People

            Assignee:
            csanchez Carlos Sanchez
            Reporter:
            henriquer Henrique Rodrigues
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: