Open andyault opened 6 years ago
I tested your Dockerfile on my Raspberry Pi 3 B+ using Raspbian GNU/Linux 9.4, with USER node
, root
, or without USER config, and they all worked fine, would you please provide more info?
I can confirm that I'm able to do the same on my Raspberry Pi, so it seems like this issue is exclusive to platforms that need QEMU
So, I'm not sure if this is an issue that we @nodejs/docker can solve, the QEMU configuration may also affect this problem.
Any update?
I had the same problem . To me the solution was to use yarn just for pm2
...
RUN apk add yarn
#NOTE npm install pm2 -g will freeze in Raspberry PI 4.
RUN yarn global add pm2
...
Same issue here building multi-arch images using Docker Buildx.
Build command
docker buildx build --no-cache --platform linux/amd64,linux/arm64,linux/arm/v7 -t charl13/flood:latest .
Dockerfile (from Flood-UI/food)
ARG NODE_IMAGE=node:12.2-alpine
ARG WORKDIR=/usr/src/app/
FROM ${NODE_IMAGE} as nodebuild
ARG WORKDIR
WORKDIR $WORKDIR
# Generate node_modules
COPY package.json \
package-lock.json \
.babelrc \
.eslintrc.js \
.eslintignore \
.prettierrc \
ABOUT.md \
$WORKDIR
RUN apk add --no-cache --virtual=build-dependencies \
python build-base && \
npm install && \
apk del --purge build-dependencies
# Build static assets and remove devDependencies.
COPY client ./client
COPY server ./server
COPY shared ./shared
COPY scripts ./scripts
COPY config.docker.js ./config.js
RUN npm run build && \
npm prune --production
# Now get the clean image without any dependencies and copy compiled app
FROM ${NODE_IMAGE} as flood
ARG WORKDIR
WORKDIR $WORKDIR
# Install runtime dependencies.
RUN apk --no-cache add \
mediainfo
COPY --from=nodebuild $WORKDIR $WORKDIR
# Hints for consumers of the container.
EXPOSE 3000
VOLUME ["/data"]
# Start application.
CMD [ "npm", "start" ]
It hangs forever on this line.
RUN apk add --no-cache --virtual=build-dependencies \
python build-base && \
npm install && \
apk del --purge build-dependencies
As work around I've changed it to this line.
RUN apk add --no-cache --virtual=build-dependencies \
yarn python build-base && \
yarn install && \
apk del --purge build-dependencies
Note that I've tried to build this image on a Raspberry Pi 3 Model B+ which has an ARMv7 architecture. It hangs on the same line there as well. This is the reason why I've moved to Docker Buildx on my Mac. But as described above, building for ARMv7 (and maybe other ARM variants) makes the npm install
command hang.
Debug info
docker system info
Client:
Debug Mode: false
Plugins:
app: Docker Application (Docker Inc., v0.8.0)
buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker)
Server:
Containers: 51
Running: 5
Paused: 0
Stopped: 46
Images: 195
Server Version: 19.03.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.184-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.855GiB
Name: docker-desktop
ID: HNQQ:KMLE:OR6F:Y3KU:LJIL:BZPA:NPKV:VSGA:44VA:46WG:QGDH:LWIL
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 66
Goroutines: 73
System Time: 2019-12-10T08:26:29.6066411Z
EventsListeners: 2
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
@Charl13 I have a very similar setup as you. Did you find a solution ?
After few days of trying, I successfully built arm 32/64 bits using QEMU. Here is few things I did :
sed -i -e 's/"devDependencies"/"DISABLED_devDependencies"/g' package.json && yarn install --production --pure-lockfile \
I hope that can help ;)
Hey all, I have a pretty standard Dockerfile for running my code on top of the
node:8-alpine
image that works fine normally, but hangs indefinitely after switching to thearm32v6/node:8-alpine
variant. The only fix I was able to get working was to switch to thenode
user before callingnpm install -g
, and then switch back to theroot
user to run (I know it's against best practices, but my main concern for now is getting the image to run without errors). This does not happen for non-global packages.Note that this isn't the same as #603 because I can't even get debug messages. I've tried this on OS X and Windows, both show the same behavior.
Dockerfile:
Build log: