Skip to content

Commit

Permalink
Merge pull request #79 from fly-apps/78-node-path-not-found-error-whe…
Browse files Browse the repository at this point in the history
…n-building-image-with-alpine

Correct node path when building with Alpine
  • Loading branch information
rubys authored Jan 7, 2024
2 parents f295c76 + 2e3a15b commit 8d37918
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/generators/templates/_install_node.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ ARG YARN_VERSION=<%= yarn_version %>
<% end -%>
<% if node_version && node_version != 'lts' -%>
<% if options.alpine? -%>
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64-musl.tar.gz | tar xz -C /tmp/ && \
cp -rp /tmp/node-v${NODE_VERSION}-linux-x64-musl/* /usr/local/ && \
mkdir /usr/local/node && \
cp -rp /tmp/node-v${NODE_VERSION}-linux-x64-musl/* /usr/local/node/ && \
<% else -%>
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
Expand Down
4 changes: 3 additions & 1 deletion test/results/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ RUN apk update && \
# Install JavaScript dependencies
ARG NODE_VERSION=xxx
ARG YARN_VERSION=xxx
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64-musl.tar.gz | tar xz -C /tmp/ && \
cp -rp /tmp/node-v${NODE_VERSION}-linux-x64-musl/* /usr/local/ && \
mkdir /usr/local/node && \
cp -rp /tmp/node-v${NODE_VERSION}-linux-x64-musl/* /usr/local/node/ && \
npm install -g yarn@$YARN_VERSION && \
rm -rf /tmp/node-v${NODE_VERSION}-linux-x64-musl

Expand Down

0 comments on commit 8d37918

Please sign in to comment.