@@ -12,16 +12,8 @@ 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 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
15
+ RUN yum install https://rpm.nodesource.com/pub_${RUNTIME_VERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y && \
16
+ yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1s;
25
17
26
18
# Stage 2 - build function and dependencies
27
19
FROM node-amazonlinux AS build-image
@@ -50,11 +42,6 @@ RUN mkdir -p ${FUNCTION_DIR}
50
42
WORKDIR ${FUNCTION_DIR}/deps/aws-lambda-ric
51
43
COPY . .
52
44
53
- # Node14 uses npm@6.14.18 by default which will downgrade permissions, if it's root,
54
- # before running any build scripts: https://github.com/npm/npm/issues/3497
55
- # Starting from npm@7.0.0, when npm is run as root,
56
- # scripts are always run with the effective uid and gid of the working directory owner.
57
- RUN if [[ $(node -v | cut -c 1-3) == "v14" ]] ; then npm install -g npm@7 ; fi
58
45
RUN make build && \
59
46
npm run test:unit
60
47
0 commit comments