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

COPY command with multiple source file fails

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I have a Docker file with the following COPY command:
      COPY bin/server.crt bin/server.key /etc/httpd/ssl/

      I get the following exception on build:
      _ERROR: Build step failed with exception
      java.lang.RuntimeException: java.lang.ClassCastException: org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl cannot be cast to javax.json.JsonString
      at org.jenkinsci.plugins.dockerbuildstep.cmd.CreateImageCommand.execute(CreateImageCommand.java:139)
      at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:75)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1720)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:404)
      Caused by: java.lang.ClassCastException: org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl cannot be cast to javax.json.JsonString
      at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getJsonString(JsonObjectBuilderImpl.java:194)
      at org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl.getString(JsonObjectBuilderImpl.java:199)
      at org.jenkinsci.plugins.dockerbuildstep.cmd.CreateImageCommand$1.callback(CreateImageCommand.java:123)
      at org.jenkinsci.plugins.dockerbuildstep.cmd.CreateImageCommand.readJsonStream(CreateImageCommand.java:161)
      at org.jenkinsci.plugins.dockerbuildstep.cmd.CreateImageCommand.execute(CreateImageCommand.java:115)
      ... 10 more
      Build step 'Execute Docker command' marked build as failure
      Finished: FAILURE_

      If I split the COPY into 2 separate commands then it works fine.

        Attachments

          Activity

          Hide
          mattdodge Matt Dodge added a comment -

          This was happening to me too but updating the plugin solved it for me. I was on 1.35 but now on 1.38 the issue doesn't seem to occur.

          Show
          mattdodge Matt Dodge added a comment - This was happening to me too but updating the plugin solved it for me. I was on 1.35 but now on 1.38 the issue doesn't seem to occur.

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              balint_bako Balint Bako
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: