Home > front end >  ERROR FROM docker.io/library/build:latest containerizing svelte
ERROR FROM docker.io/library/build:latest containerizing svelte

Time:09-12

I am getting the follow issue, that I can't seem to google correctly. I am trying to build sveltekit inside a container to run on my linux server. I tried several different distros of alpine get the same issue. I get 200 when I try to curl https://docker.io/library/build:latest

 => ERROR FROM docker.io/library/build:latest                                                                            1.3s
 => => resolve docker.io/library/build:latest                                                                            1.3s
 => CANCELED [deploy-node 1/6] FROM docker.io/library/node:18-alpine3.15@sha256:bc11ceb232df9f6758dd2a05aeb65e103f8e8f9

------
 > FROM docker.io/library/build:latest:
------
failed to solve: failed to load cache key: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
version: "3.7"

services:
  app-node:
    image: svelte-docker-node
    build:
      context: .
      dockerfile: Dockerfile
      target: deploy-node
    ports:
      - 3000:3000

dockerfile

FROM node:18-alpine3.15 AS deploy-node

WORKDIR /app
RUN rm -rf ./*
COPY --from=build /app/package.json .
COPY --from=build /app/build .
RUN yarn --Prod
CMD ["node", "index.js"]

CodePudding user response:

This looks like it's been copied from a multi-stage build, and is missing the other stages.

COPY --from=build /app/package.json .
COPY --from=build /app/build .

The --from option looks for another stage with that name, e.g. you've defined a deploy-node stage:

FROM node:18-alpine3.15 AS deploy-node

When it can't find the stage, it falls back to copying from an image with that name, and there's no build:latest image on Docker Hub, so the copy fails.

  • Related