title: How to resolve "Cannot retrieve .Id from docker" when building Docker image using Jenkins pipeline
body: <p>I am using a Jenkins pipeline to build a Dockerfile. </p>
  
  <p>The dockerfile successfully goes through all steps, and creates the docker image.</p>
  
  <p>As shown:</p>
  
  <pre><code>Step 16/19 : FROM base AS final
   ---&gt; &lt;id&gt;
  Step 17/19 : WORKDIR /app
   ---&gt; Using cache
   ---&gt; &lt;id&gt;
  Step 18/19 : COPY --from=publish /app .
   ---&gt; Using cache
   ---&gt; &lt;id&gt;
  Step 19/19 : ENTRYPOINT ["", "myapp.dll"]
   ---&gt; Using cache
   ---&gt; &lt;id&gt;
  Successfully built cb3y81938e88
  Successfully tagged myapp:latest
  </code></pre>
  
  <p>However, after this, the shell Fails with the following error:</p>
  
  <pre><code>java.io.IOException: Cannot retrieve .Id from 'docker inspect base AS final'
  </code></pre>
  
  <p>Why does it throw this error despite the docker image successfully built? 
  When I execute this on my local machine, the command exits on "Successfully tagged myapp:latest"</p>
  
  <p>My docker version is 18.03.1-ce.</p>
  
  <p>Any help on this issue would be greatly appreciated!</p>