nodejs / docker-node

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

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

Open arensade opened 6 months ago

arensade commented 6 months 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 6 months 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 6 months 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 6 months ago

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

GabrielBragaGit commented 4 weeks ago

After trying a million alternatives, what magically resolved for me was swapping npm for yarn.