Skip to content

Commit 827ab73

Browse files
authored
Merge pull request #68 from udx/arm64-shebang-fix
Added /usr/local/bin to PATH and refine npm/npx shebangs
2 parents b1aaebb + d8e7972 commit 827ab73

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Dockerfile

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

44
# Add metadata labels
5-
LABEL version="0.28.0"
5+
LABEL version="0.29.0"
66

77
# Set build arguments for Node.js version and application port
88
ARG NODE_VERSION=22.21.1
99
ARG APP_PORT=8080
1010

1111
# Add Node.js to PATH
12-
ENV PATH="/usr/local/node/bin:${PATH}"
12+
ENV PATH="/usr/local/bin:/usr/local/node/bin:${PATH}"
1313

1414
# Set application-specific environment variables
1515
ENV APP_HOME="/usr/src/app" \
@@ -47,18 +47,19 @@ RUN set -ex && \
4747
# Rewrite shebangs to avoid /usr/bin/env (BuildKit/QEMU arm64-safe)
4848
sed -i '1 s|^#!.*|#!/usr/local/node/bin/node|' /usr/local/node/lib/node_modules/npm/bin/npm-cli.js && \
4949
sed -i '1 s|^#!.*|#!/usr/local/node/bin/node|' /usr/local/node/lib/node_modules/npm/bin/npx-cli.js && \
50+
sed -i '1 s|^#!.*|#!/usr/local/node/bin/node|' /usr/local/node/bin/npm && \
51+
sed -i '1 s|^#!.*|#!/usr/local/node/bin/node|' /usr/local/node/bin/npx && \
5052
ln -sf /usr/local/node/bin/node /usr/local/bin/node && \
51-
# Provide npm/npx launchers without /usr/bin/env (buildx/QEMU arm64-safe)
53+
# Provide npm/npx launchers in /usr/local/bin (preferred via PATH)
5254
printf '%s\n' '#!/bin/sh' \
5355
'exec /usr/local/node/bin/node /usr/local/node/lib/node_modules/npm/bin/npm-cli.js "$@"' \
5456
> /usr/local/bin/npm && chmod +x /usr/local/bin/npm && \
5557
printf '%s\n' '#!/bin/sh' \
5658
'exec /usr/local/node/bin/node /usr/local/node/lib/node_modules/npm/bin/npx-cli.js "$@"' \
5759
> /usr/local/bin/npx && chmod +x /usr/local/bin/npx && \
58-
# Verify installation
60+
# Verify installation and resolution path
5961
node --version && \
60-
npm --version && \
61-
# Cleanup
62+
command -v npm && head -n 1 "$(command -v npm)" && npm --version && \
6263
rm -rf /tmp/*
6364

6465
# Remove xz-utils as it's no longer needed

0 commit comments

Comments
 (0)