title: FROM...AS in Dockerfile not working as I expect
body: <p>I am just learning to use Docker, so please bear with me.</p>
  
  <p>I want to make a docker image that builds on top of another docker image I have already built. In my dockerfile, I refer to a specific version of the base image, but for the sake of maintainability, I only want to mention that version only once in the dockerfile. The dockerfile documentation seems to suggest to me that I can use the 'AS' keyword to map a symbolic name to the specific version tag. In the --from parameter to a next COPY instruction, I should then be able to use the symbolic name instead of the specific image:version tag.</p>
  
  <p>This is my dockerfile:</p>
  
  <pre><code>FROM base:2.0 AS my_base
  
  WORKDIR /child2
  
  COPY --from=my_base /base /child2
  COPY . /child2
  
  CMD ["python", "-u", "child2.py"]
  </code></pre>
  
  <p>When I build using this dockerfile with</p>
  
  <pre><code>docker build -t child2 .
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Step 1/5 : FROM base:2.0 AS my_base
   ---&gt; c5e2be45da55
  Step 2/5 : WORKDIR /child2
   ---&gt; Using cache
   ---&gt; 1b5a4ad816c9
  Step 3/5 : COPY --from=my_base /base /child2
  invalid from flag value my_base: pull access denied for my_base, repository does not exist or may require 'docker login'
  </code></pre>
  
  <p>I did use 'docker login', but I got the exact same error again.</p>
  
  <p>Do I make some mistake in the syntax of the dockerfile, or is my assumption on the use of the AS keyword simply incorrect?</p>
  
  <p>I am using Docker version 18.09.2 on Windows 10.</p>