Skip to content

Commit 8ec0dd8

Browse files
authored
Merge pull request #66 from udx/arm64-shebang-fix
Shell wrapper for npm cli
2 parents 9d1d93b + f522621 commit 8ec0dd8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
FROM usabilitydynamics/udx-worker:0.37.0
33

44
# Add metadata labels
5-
LABEL version="0.26.0"
5+
LABEL version="0.27.0"
66

77
# Set build arguments for Node.js version and application port
88
ARG NODE_VERSION=22.21.1
@@ -46,11 +46,16 @@ RUN set -ex && \
4646
tar -xJf "node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" --strip-components=1 -C /usr/local/node && \
4747
# Create symlinks
4848
ln -sf /usr/local/node/bin/node /usr/local/bin/node && \
49-
ln -sf /usr/local/node/bin/npm /usr/local/bin/npm && \
50-
ln -sf /usr/local/node/bin/npx /usr/local/bin/npx && \
49+
# Provide npm/npx launchers without /usr/bin/env (buildx/QEMU arm64-safe)
50+
printf '%s\n' '#!/bin/sh' \
51+
'exec node /usr/local/node/lib/node_modules/npm/bin/npm-cli.js "$@"' \
52+
> /usr/local/bin/npm && chmod +x /usr/local/bin/npm && \
53+
printf '%s\n' '#!/bin/sh' \
54+
'exec node /usr/local/node/lib/node_modules/npm/bin/npx-cli.js "$@"' \
55+
> /usr/local/bin/npx && chmod +x /usr/local/bin/npx && \
5156
# Verify installation
5257
node --version && \
53-
node /usr/local/node/lib/node_modules/npm/bin/npm-cli.js --version && \
58+
npm --version && \
5459
# Cleanup
5560
rm -rf /tmp/*
5661

0 commit comments

Comments
 (0)