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

Jenkins Pipeline still uses --force=yes for Docker Pipeline plugin

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • docker-workflow-plugin
    • Jenkins ver. 2.19.4
      CloudBees Docker Build and Publish plugin 1.3.2
      Docker Pipeline 1.9.1
      Running on Ubuntu 16.04

      The `--force` flag is still being set to true for Pipeline Docker build and publish steps. I'm running into the issue when executing a job to build and publish an image to a registry:
      + docker tag --force=true foo:tag foo:tag
      unknown flag: --force
      See 'docker tag --help'.
      The relevant bit from my Jenkinsfile:
      node {
      stage('deploy')

      { git branch: 'feature/branch', credentialsId: 'foo-key', url: 'git@github.com:bar/baz.git' withDockerRegistry([credentialsId: 'ecr:us-east-1:foo-key', url: 'https://etcetera/']) { docker.image('foo:tag').push() }

          [JENKINS-41148] Jenkins Pipeline still uses --force=yes for Docker Pipeline plugin

          John Hovell added a comment -

          Any known workaround? (other than don't use plugin and write docker commands in sh directly)?

          Just ran into this issue after upgrading to Docker 1.12.6 (from 1.11.2). Also affects Jenkins 2.32.1. Running Ubuntu Xenial 16.04.

          Surprised more people aren't running into this?

          John Hovell added a comment - Any known workaround? (other than don't use plugin and write docker commands in sh directly)? Just ran into this issue after upgrading to Docker 1.12.6 (from 1.11.2). Also affects Jenkins 2.32.1. Running Ubuntu Xenial 16.04. Surprised more people aren't running into this?

          Also ran across this. Operation seems to complete even with the thrown error, but still, it's supposed to be fixed according to changelogs, and isn't.

          Aaron Greengrass added a comment - Also ran across this. Operation seems to complete even with the thrown error, but still, it's supposed to be fixed according to changelogs, and isn't.

          John Hovell added a comment -

          On closer examination, there was a bug in my code. This just happened to be the last message in the log and looked like an error, but I think the || operator renders this error harmless, just log noise sa_jbrooks.

          John Hovell added a comment - On closer examination, there was a bug in my code. This just happened to be the last message in the log and looked like an error, but I think the || operator renders this error harmless, just log noise sa_jbrooks .

          Wojciech Duda added a comment - - edited

          jhovell There is actually abug and this should not have been closed. If you for example try to push an image, tag it and then push the second tag (i.e. you want to push "latest" and a version, the build will fail on the tagging part with docker 1.12 and higher. I created https://issues.jenkins-ci.org/browse/JENKINS-42152 as a report for this. sa_jbrooks was right, the code has not been fixed.

          Wojciech Duda added a comment - - edited jhovell There is actually abug and this should not have been closed. If you for example try to push an image, tag it and then push the second tag (i.e. you want to push "latest" and a version, the build will fail on the tagging part with docker 1.12 and higher. I created https://issues.jenkins-ci.org/browse/JENKINS-42152 as a report for this. sa_jbrooks was right, the code has not been fixed.

          Maksim Skutin added a comment -

          wduda, you are right. Get into exactly the same issue.

          Maksim Skutin added a comment - wduda , you are right. Get into exactly the same issue.

          Wojciech Duda added a comment -

          I actually created a pull request for JENKINS-42152 already, hopefully my code is solid enough to be accepted.

          Wojciech Duda added a comment - I actually created a pull request for JENKINS-42152 already, hopefully my code is solid enough to be accepted.

          Maksim Skutin added a comment -

          I actually added +1 to your pull request, looking forward for a review.

          Maksim Skutin added a comment - I actually added +1 to your pull request, looking forward for a review.

          wduda, I'm not sure your code works; I get this error:

           

          + docker version --format '{{.Client.Version}}'
          [...]
          groovy.lang.MissingPropertyException: No such property: dockerVersion for class: org.jenkinsci.plugins.docker.workflow.Docker
          

           

           

          Jo Vandeginste added a comment - wduda , I'm not sure your code works; I get this error:   + docker version --format '{{.Client.Version}}' [...] groovy.lang.MissingPropertyException: No such property: dockerVersion for class: org.jenkinsci.plugins.docker.workflow.Docker    

          Jack Brooks added a comment -

          jhovell, as the other posters point out, this is definitely still an issue, and- at least for me- isn't just a warning or the last message in the log. Hopefully wduda's PR will get merged (with any needed changes).

          Jack Brooks added a comment - jhovell , as the other posters point out, this is definitely still an issue, and- at least for me- isn't just a warning or the last message in the log. Hopefully wduda 's PR will get merged (with any needed changes).

          Wojciech Duda added a comment -

          Wojciech Duda added a comment - jovandeginste sa_jbrooks Pull request for https://issues.jenkins-ci.org/browse/JENKINS-42152  will be updated today.

            Unassigned Unassigned
            sa_jbrooks Jack Brooks
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: