title: Cannot Build Docker Image with Angular 9 - Simple App
body: <p>I have followed a very simple YouTube video on how to dockerize a very simple Angular 9 app.</p>
  <p>I built the angular 9 app by typing in &quot;ng new angular-docker&quot;.  Answered no to routing and chose CSS.  A picture of the source files is shown at the bottom.</p>
  <p>I then created a Dockerfile at the main level of the app. Added the following code to the Dockerfile.  I have tried different version of node and nginx in the Dockerfile to no luck.</p>
  <pre><code># stage 1 get any base dockerhub images
  FROM node:12.2.0 AS builder
  
  # here I build a base working directory &quot;inside the image!&quot; as /app
  WORKDIR /app
  
  # this copy will copy all files from the ANGULAR-DOCKER folder to the /app directory in the image.
  COPY . .
  
  RUN npm install
  RUN npm run build --prod
  
  #STAGE 2
  FROM nginx:1.15.8-alpine
  COPY --from=builder /app/dist/angular-docker /usr/share/nginx/html
  </code></pre>
  <p>When I try and build the image from the Visual Studio Code palette, I get the following errors:</p>
  <pre><code>&gt; Executing task: docker build --pull --rm -f &quot;Dockerfile&quot; -t angulardocker:latest &quot;.&quot; &lt;
  
  [+] Building 1.8s (7/12)
   =&gt; [internal] load .dockerignore                                                                                                                                                 0.0s 
   =&gt; =&gt; transferring context: 2B                                                                                                                                                   0.0s 
   =&gt; [internal] load build definition from Dockerfile                                                                                                                              0.0s 
   =&gt; =&gt; transferring dockerfile: 32B                                                                                                                                               0.0s 
   =&gt; ERROR [internal] load metadata for docker.io/library/nginx:1.15.8-alpine                                                                                                      1.1s 
   =&gt; ERROR [internal] load metadata for docker.io/library/node:12.2.0                                                                                                              1.0s 
   =&gt; ERROR [builder 1/5] FROM docker.io/library/node:12.2.0                                                                                                                        0.7s 
   =&gt; =&gt; resolve docker.io/library/node:12.2.0                                                                                                                                      0.7s 
   =&gt; CANCELED [stage-1 1/2] FROM docker.io/library/nginx:1.15.8-alpine                                                                                                             0.7s 
   =&gt; =&gt; resolve docker.io/library/nginx:1.15.8-alpine                                                                                                                              0.7s 
   =&gt; [internal] load build context                                                                                                                                                 0.0s 
  ------
   &gt; [internal] load metadata for docker.io/library/nginx:1.15.8-alpine:
  ------
  ------
   &gt; [internal] load metadata for docker.io/library/node:12.2.0:
  ------
  ------
   &gt; [builder 1/5] FROM docker.io/library/node:12.2.0:
  ------
  failed to solve with frontend dockerfile.v0: failed to build LLB: failed to load cache key: failed to fetch oauth token: unexpected status: 401 Unauthorized
  The terminal process &quot;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command docker build --pull --rm -f &quot;Dockerfile&quot; -t angulardocker:latest &quot;.&quot;&quot; terminated with exit code: 1.
  </code></pre>
  <p>Any ideas on what I am doing wrong?  Thank you.</p>
  <p><a href="https://i.stack.imgur.com/A9p3M.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A9p3M.jpg" alt="enter image description here" /></a></p>