Closed amoya-revo closed 3 months ago
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.
Thanks a lot! It worked as a charm
Thanks again
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
@natcl are you trying to build cross-platform? If not dropping the architecture namespace should do the trick
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...
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
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"]
Interesting, can be a nice workaround !
Environment
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)
Possible Solution
Steps to Reproduce
build an image using arm64v8 alpine images
Additional Information