nodejs / docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:
https://hub.docker.com/_/node/
MIT License
8.13k stars 1.95k forks source link

Docker build stucks on FROM --platform=linux/amd64 node:current-alpine image #2075

Open arensade opened 1 month ago

arensade commented 1 month ago

Environment

Expected Behavior

after RUN cmd run build it should goes to push the layer into Remote repo.

Current Behavior

Docker stucks on

RUN npm run build

Possible Solution

Steps to Reproduce

FROM --platform=linux/amd64 node:current-alpine

WORKDIR /app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 80

RUN npm run build

CMD [ "node", "index.js"]
LaurentGoderre commented 1 month ago

This has more to do about the script being run by the build command than this image. What is your build command running?

arensade commented 1 month ago

RUN npm run build just build qwik js application that works well on all node version expect --platform=linux/amd64. I just test in on at least node:22 node:18 and node:current-alpine but when I add platform its stucks on build layer.

LaurentGoderre commented 1 month ago

What's the output of the build? It's possible it's building the app for the wrong architecture.