File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,16 @@ ARG DISTRO_VERSION
12
12
# Install Py3 required to build Node16+
13
13
RUN if [[ "${DISTRO_VERSION}" == "2" ]] ; then amazon-linux-extras install python3.8 && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 ; fi
14
14
# Install NodeJS
15
- RUN curl -sL https://rpm.nodesource.com/setup_${RUNTIME_VERSION}.x | bash - && \
16
- yum install -y nodejs
17
-
15
+ RUN if [[ "${RUNTIME_VERSION}" == "14" ]]; then \
16
+ yum install -y tar gzip xz && \
17
+ AARCH="$([[ "$(arch)" == "x86_64" ]] && echo "x64" || echo "arm64")" && \
18
+ NODE_URL="https://nodejs.org/download/release/v14.21.3/node-v14.21.3-linux-$AARCH.tar.xz" && \
19
+ curl -fL "$NODE_URL" | tar -C /usr --strip-components 1 -xJf - && \
20
+ yum clean all -q && rm -rf /var/cache/yum ; \
21
+ else \
22
+ yum install https://rpm.nodesource.com/pub_${RUNTIME_VERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y && \
23
+ yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1s ; \
24
+ fi
18
25
19
26
# Stage 2 - build function and dependencies
20
27
FROM node-amazonlinux AS build-image
You can’t perform that action at this time.
0 commit comments