Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unable to load metadata on arm64v8 #2110

Closed
amoya-revo opened this issue Jun 24, 2024 · 9 comments
Closed

Error: Unable to load metadata on arm64v8 #2110

amoya-revo opened this issue Jun 24, 2024 · 9 comments

Comments

@amoya-revo
Copy link

amoya-revo commented Jun 24, 2024

Environment

  • Platform:arm64v8
  • Docker Version:26.1.3, build b72abbb
  • Node.js Version:20
  • Image Tag:lts-alpine

Expected Behavior

It should be able to get the image and metadata from repositosy

Current Behavior

Docker is not being able to locate the metadata. This behavior started on 24/Jun/2024 on tag latest and today is affecting other images (alpine3.19, alpine-lts)

#5 [internal] load metadata for docker.io/arm64v8/node:lts-alpine
#5 ERROR: no match for platform in manifest: not found

#4 [internal] load metadata for docker.io/library/node:latest
#4 CANCELED
------
 > [internal] load metadata for docker.io/arm64v8/node:lts-alpine:
------
dockerfile:21
--------------------
  19 |     
  20 |     # Stage 2: Setup the production environment
  21 | >>> FROM arm64v8/node:lts-alpine
  22 |     
  23 |     WORKDIR /usr/src/app
--------------------
ERROR: failed to solve: arm64v8/node:lts-alpine: failed to resolve source metadata for docker.io/arm64v8/node:lts-alpine: no match for platform in manifest: not found
Error: Process completed with exit code 1.

Possible Solution

Steps to Reproduce

build an image using arm64v8 alpine images

Additional Information

@yosifkit
Copy link
Contributor

The arm64v8/node images are now an image index (with a provenance and SBOM doc), so if they are pulled from a non-arm64v8 host then a platform specification (like --platform=linux/arm64) is required for docker to pull it correctly.

@amoya-revo
Copy link
Author

Thanks a lot! It worked as a charm

@amoya-revo
Copy link
Author

Thanks again

@natcl
Copy link

natcl commented Jun 28, 2024

Out of curiosity is there a workaround for this ? When using gitlab ci there is sadly no current way to specify --platform when they pull the image so the newer images break...

Related to this issue: https://gitlab.com/gitlab-org/gitlab/-/issues/392011

@LaurentGoderre
Copy link
Member

@natcl are you trying to build cross-platform? If not dropping the architecture namespace should do the trick

@natcl
Copy link

natcl commented Jun 28, 2024

Yes in my case I'm trying to build arm64 on AMD64...
I was able to get around by fetching a generic arm64v8/alpine image and installing node manually in it, that specific image doesn't trigger the same error. Wish gitlab would fix the issue however...

@natcl
Copy link

natcl commented Jul 2, 2024

For anyone having the same issue with gitlab, the support for platform is actually in the latest runners:
https://docs.gitlab.com/17.1/ee/ci/yaml/#imagedocker

@amoya-revo
Copy link
Author

amoya-revo commented Jul 2, 2024

if it helps in any form, this is my dockerfile including the platform specification - in stage 2

# Use a multi-stage build to reduce the image size
# Stage 1: Build the application
FROM node:latest as builder
WORKDIR /usr/src/app
COPY ./package*.json ./
RUN npm install
COPY . .
RUN npm run build

# Stage 2: Setup the production environment
FROM --platform=linux/arm64 arm64v8/node:lts-alpine
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules
EXPOSE 3000
CMD [ "node", "dist/main"]

@natcl
Copy link

natcl commented Jul 2, 2024

Interesting, can be a nice workaround !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants