title: Dockerfile build raising insufficient_scope: authorization failed with public openjdk image
body: <p>I'm trying to run the following Dockerfile using the command</p>
  <pre><code>docker-compose up --remove-orphans --force-recreate --build -d
  </code></pre>
  <p>Dockerfile:</p>
  <pre><code>FROM maven:3.6.3-jdk-11 as builder
  COPY src /home/app/src     
  COPY pom.xml /home/app
  RUN mvn -f /home/app/pom.xml clean package
  
  FROM openjdk:latest
  COPY --from=build /usr/src/app/target/app.jar /home/app/app.jar
  EXPOSE 8080
  ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/home/app/app.jar&quot;]
  </code></pre>
  <p>The build stage runs ok, however the run stage raises the following error:</p>
  <pre><code>Building java
  failed to get console mode for stdout: The handle is invalid.
  [+] Building 1.5s (4/6)
  =&gt; [internal] load build definition from Dockerfile                       0.0s
  =&gt; [internal] load build definition from Dockerfile                       0.0s
  =&gt; =&gt; transferring dockerfile: 380B                                       0.0s
  =&gt; [internal] load .dockerignore                                          0.0s
  =&gt; =&gt; transferring context: 2B                                            0.0s
  =&gt; [internal] load metadata for docker.io/library/openjdk:latest          1.2s
  =&gt; ERROR FROM docker.io/library/build:latest                              1.7s
  =&gt; =&gt; resolve docker.io/library/build:latest                              1.7s
  =&gt; CACHED [stage-1 1/2] FROM docker.io/library/openjdk:latest@sha256:e4f  0.0srequire 
  authorization: server message: insufficient_scope: authorization failed
  =&gt; [auth] library/build:pull token for registry-1.docker.io               0.0s
  </code></pre>
  <p>First I though it was an authentication problem so I logged in the Docker desktop, but still it does not work.
  Is there any log that I can check or any reference to try find the root of this problem?</p>
  <p>Thanks in advance</p>