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

build parameter not usable in Docker build step

XMLWordPrintable

      Docker build step plugin version: 1.38
      Jenkins Version: 2.32.1 LTS

      I set a build parameter called VERSION, which I successfully use in a shell build step.
      Setting this parameter as tag (I put ${VERSION} in the tag field) in the Docker build step (push image) however fails in following error:

      [Docker] INFO: Pushing image <our private repository>:5000/path/image${ VERSION };
      12:30:27 ERROR: Build step failed with exception
      12:30:27 java.lang.IllegalStateException: The template variable 'VERSION' has no value
      12:30:27 	at org.glassfish.jersey.client.JerseyWebTarget.getUri(JerseyWebTarget.java:134)
      12:30:27 	at org.glassfish.jersey.client.JerseyWebTarget.request(JerseyWebTarget.java:214)
      

      I tried putting just $VERSION in the tag field, resulting in the following error:

      [Docker] INFO: Pushing image <our private repository>:5000/path/image:$VERSION
      12:34:28 [Docker] ERROR: Failed to push image:{"message":"Error parsing reference: \"<our private repository>:5000/path/image:$VERSION\" is not a valid repository/tag"}
      12:34:28 
      12:34:28 [Docker] ERROR: command 'Push image' failed: {"message":"Error parsing reference: \"<our private repository>:5000/path/image:$VERSION\" is not a valid repository/tag"}
      12:34:28 
      12:34:28 ERROR: {"message":"Error parsing reference: \"<our private repository>:5000/path/image:$VERSION\" is not a valid repository/tag"}
      12:34:28 
      12:34:28 Finished: FAILURE
      

            vjuranek vjuranek
            michaelniemand Michael Niemand
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: