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

Build does not fail if docker build fails

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If your docker build fails the jobs will still succeed.

      We see in the console output:

      time="2015-05-19T21:13:57+01:00" level=info msg="The command [/bin/sh -c failed command returned a non-zero code: 1" 

      But then

      Finished: SUCCESS

      Steps to reproduce

      Build this dockerfile:

      FROM ubuntu
      RUN exit 1
      

      Expected Results

      The build should fail

      Actual Results

      The build succeeds.

      I would expect this to cause us to stop building, I also wouldn't expect us to push and tag the image.

        Attachments

          Issue Links

            Activity

            Hide
            vrehak Vaclav Rehak added a comment -

            There is similar problem if "docker login" fails (e.g. due to frequent outages of Docker Hub) - I would expect the build to stop immediately but it goes on with building.

            [myproject] $ docker login -u myusername -e me@mycompany.com -p ********
            time="2015-05-20T06:01:23-04:00" level=fatal msg="Error response from daemon: </html> (Code: 500; Headers: map[Vary:[Cookie] X-Frame-Options:[SAMEORIGIN] Strict-Transport-Security:[max-age=31536000] Server:[nginx/1.6.2] Date:[Wed, 20 May 2015 10:01:22 GMT] Content-Type:[text/html; charset=utf-8]])"
            [myproject] $ docker build -t mycompany/myproject:4d20ec41fd2bb0e5d6839e55511815ec9fe89c10 --pull=true .
            ....

            Show
            vrehak Vaclav Rehak added a comment - There is similar problem if "docker login" fails (e.g. due to frequent outages of Docker Hub) - I would expect the build to stop immediately but it goes on with building. [myproject] $ docker login -u myusername -e me@mycompany.com -p ******** time="2015-05-20T06:01:23-04:00" level=fatal msg="Error response from daemon: </html> (Code: 500; Headers: map[Vary: [Cookie] X-Frame-Options: [SAMEORIGIN] Strict-Transport-Security: [max-age=31536000] Server: [nginx/1.6.2] Date: [Wed, 20 May 2015 10:01:22 GMT] Content-Type: [text/html; charset=utf-8] ])" [myproject] $ docker build -t mycompany/myproject:4d20ec41fd2bb0e5d6839e55511815ec9fe89c10 --pull=true . ....
            Hide
            andy Andy Smith added a comment -

            Looks like this issue has already been fixed here: https://github.com/jenkinsci/docker-build-publish-plugin/pull/19

            Just not released yet

            Show
            andy Andy Smith added a comment - Looks like this issue has already been fixed here: https://github.com/jenkinsci/docker-build-publish-plugin/pull/19 Just not released yet
            Hide
            andy Andy Smith added a comment -

            Vaclav, sorry I didn't see your comment until I closed. May be worth opening a new issue unless your issue is also fixed by the pull request linked above.

            Show
            andy Andy Smith added a comment - Vaclav, sorry I didn't see your comment until I closed. May be worth opening a new issue unless your issue is also fixed by the pull request linked above.

              People

              Assignee:
              michaelneale Michael Neale
              Reporter:
              andy Andy Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: