Skip to content

Commit

Permalink
Fix up old Alpine image issues: do not ship Node.js for 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jokesterfr committed Dec 4, 2023
1 parent 39da558 commit 337eb8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ RUN PHP_CS_FIXER=$(jq -r '."'"${PHP_VERSION}"'".php_cs_fixer' < /tmp/php-flavour
&& chmod a+x /usr/bin/php-cs-fixer

# Install Node.js and pnpm (yarn and npm are included)
RUN apk --no-cache add -U gcompat && \
if [ "linux/arm64" = "$TARGET_PLATFORM" ]; \
RUN if [ "0.0.0" = "$NODE_VERSION" ]; then exit 0; fi \
&& apk --no-cache add -U gcompat \
&& if [ "linux/arm64" = "$TARGET_PLATFORM" ]; \
then export DISTRO="linux-arm64"; \
else export DISTRO="linux-x64"; \
fi \
&& curl --silent --show-error --fail --location --output /tmp/node.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${DISTRO}.tar.xz" \
&& mkdir /tmp/nodejs && tar -xJf /tmp/node.tar.xz -C /tmp/nodejs \
&& mv "/tmp/nodejs/node-v${NODE_VERSION}-${DISTRO}" /usr/local/lib/nodejs && rmdir /tmp/nodejs \
&& rm -f /tmp/node.tar.xz \
&& mv "/tmp/nodejs/node-v${NODE_VERSION}-${DISTRO}" /usr/local/lib/nodejs \
&& rm -rf /tmp/nodejs /tmp/node.tar.xz \
&& PATH="$PATH:/usr/local/lib/nodejs/bin" npm install -g pnpm@latest --force
ENV PATH "$PATH:/usr/local/lib/nodejs/bin"

Expand Down
7 changes: 4 additions & 3 deletions docker/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ RUN PHP_CS_FIXER=$(jq -r '."'"${PHP_VERSION}"'".php_cs_fixer' < /tmp/php-flavour
&& chmod a+x /usr/bin/php-cs-fixer

# Install Node.js and pnpm (yarn and npm are included)
RUN if [ "linux/arm64" = "$TARGET_PLATFORM" ]; \
RUN if [ "0.0.0" = "$NODE_VERSION" ]; then exit 0; fi \
&& if [ "linux/arm64" = "$TARGET_PLATFORM" ]; \
then export DISTRO="linux-arm64"; \
else export DISTRO="linux-x64"; \
fi \
&& curl --silent --show-error --fail --location --output /tmp/node.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${DISTRO}.tar.xz" \
&& mkdir /tmp/nodejs && tar -xJf /tmp/node.tar.xz -C /tmp/nodejs \
&& mv "/tmp/nodejs/node-v${NODE_VERSION}-${DISTRO}" /usr/local/lib/nodejs && rmdir /tmp/nodejs \
&& rm -f /tmp/node.tar.xz \
&& mv "/tmp/nodejs/node-v${NODE_VERSION}-${DISTRO}" /usr/local/lib/nodejs \
&& rm -rf /tmp/nodejs /tmp/node.tar.xz \
&& PATH="$PATH:/usr/local/lib/nodejs/bin" npm install -g pnpm@latest --force
ENV PATH "$PATH:/usr/local/lib/nodejs/bin"

Expand Down
2 changes: 1 addition & 1 deletion prestashop-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compatible": ["5.2", "5.3", "5.4", "5.5", "5.6", "7.0", "7.1"]
},
"nodejs": {
"recommended": "10.24.1"
"recommended": "0.0.0"
}
},
"^1.7.[0-3]": {
Expand Down

0 comments on commit 337eb8c

Please sign in to comment.