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

Option to disable automatic tagging of docker images with dockerfile agents

      When specifying dockerfile as agent in a jenkins pipeline e.g. :

      pipeline {
          agent {
              dockerfile {
                  additionalBuildArgs '-t image_name:latest'
                  label 'docker'

      The docker pipeline plugin executes the following to build the image:

      docker build -t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e -t image_name:latest -f Dockerfile .

      How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

      Thanks a lot in advance!

          [JENKINS-51544] Option to disable automatic tagging of docker images with dockerfile agents

          Julien Siems created issue -
          Julien Siems made changes -
          Description Original: When specifying dockerfile as agent in a jenkins pipeline e.g. :

          {{pipeline \{}}
          {{    agent \{}}
          {{        dockerfile \{}}
          {{            additionalBuildArgs '-t image_name:latest'}}
          {{            label 'docker'}}
          {{        }}}
          {{    }}}{{...}}{{}}}

          The docker pipeline plugin executes the following to build the image:

          {{docker build *-t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e* -t image_name:latest -f Dockerfile .}}

          How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

          Thanks a lot in advance!
          New: When specifying dockerfile as agent in a jenkins pipeline e.g. :

          {{pipeline \{}}
           {{    agent \{}}
           {{        dockerfile \{}}
           {{            additionalBuildArgs '-t image_name:latest'}}
           {{            label 'docker'}}

          ...

          }

          The docker pipeline plugin executes the following to build the image:

          {{docker build *-t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e* -t image_name:latest -f Dockerfile .}}

          How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

          Thanks a lot in advance!
          Julien Siems made changes -
          Description Original: When specifying dockerfile as agent in a jenkins pipeline e.g. :

          {{pipeline \{}}
           {{    agent \{}}
           {{        dockerfile \{}}
           {{            additionalBuildArgs '-t image_name:latest'}}
           {{            label 'docker'}}

          ...

          }

          The docker pipeline plugin executes the following to build the image:

          {{docker build *-t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e* -t image_name:latest -f Dockerfile .}}

          How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

          Thanks a lot in advance!
          New: When specifying dockerfile as agent in a jenkins pipeline e.g. :

          {{pipeline \{}}
           {{    agent \{}}
           {{        dockerfile \{}}
           {{            additionalBuildArgs '-t image_name:latest'}}
           {{            label 'docker'}}

          }

          The docker pipeline plugin executes the following to build the image:

          {{docker build *-t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e* -t image_name:latest -f Dockerfile .}}

          How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

          Thanks a lot in advance!
          Julien Siems made changes -
          Description Original: When specifying dockerfile as agent in a jenkins pipeline e.g. :

          {{pipeline \{}}
           {{    agent \{}}
           {{        dockerfile \{}}
           {{            additionalBuildArgs '-t image_name:latest'}}
           {{            label 'docker'}}

          }

          The docker pipeline plugin executes the following to build the image:

          {{docker build *-t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e* -t image_name:latest -f Dockerfile .}}

          How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

          Thanks a lot in advance!
          New: When specifying dockerfile as agent in a jenkins pipeline e.g. :

          {{pipeline \{}}
           {{    agent \{}}
           {{        dockerfile \{}}
           {{            additionalBuildArgs '-t image_name:latest'}}
           {{            label 'docker'}}

          The docker pipeline plugin executes the following to build the image:

          {{docker build *-t 0c5e9a24b881c7c890b38ceb89cf26c5713e2c1e* -t image_name:latest -f Dockerfile .}}

          How can I disable automatically tagging the image? In this case I would like to have just one tag (image_name:latest).

          Thanks a lot in advance!
          Andrew Bayer made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]

          a b added a comment -

          I have run into this as well and would also like to be able to specify my own image name when built from a dockerfile instead of an arbitrary name. This makes it hard to manage all the images on the host.

          a b added a comment - I have run into this as well and would also like to be able to specify my own image name when built from a dockerfile instead of an arbitrary name. This makes it hard to manage all the images on the host.
          a b made changes -
          Labels Original: agents docker pipeline pipeline-build-step-plugin tag tags New: agents docker docker-workflow-plugin pipeline pipeline-build-step-plugin tag tags
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]

            Unassigned Unassigned
            jul8234 Julien Siems
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: