title: How to build docker images using a Declarative Jenkinsfile
body: <p>I'm new to using Jenkins....</p>
  
  <p>I'm trying to automate the production of an image (to be stashed in  a repo) using a declarative Jenkinsfile. I find the documentation to be confusing (at best). Simply put, how can I convert the following scripted example (from <a href="https://jenkins.io/doc/book/pipeline/docker/#building-containers" rel="noreferrer">the docs</a>)</p>
  
  <pre><code>node {
      checkout scm
      def customImage = docker.build("my-image:${env.BUILD_ID}")
      customImage.push()
  }
  </code></pre>
  
  <p>to a declarative Jenkinsfile....</p>