Skip to content

Commit

Permalink
fix: use node script to install it
Browse files Browse the repository at this point in the history
Signed-off-by: apmmachine <[email protected]>
  • Loading branch information
apmmachine authored and devcorpio committed Jan 11, 2024
1 parent f24fd06 commit ad77dd5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
23 changes: 20 additions & 3 deletions .ci/docker/node-playwright/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,26 @@ FROM ubuntu:bionic
ARG NODEJS_VERSION

# 1. Install node
RUN apt-get -qq update && apt-get -qq install -y curl && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get -qq install -y nodejs
RUN \
apt-get update > /dev/null \
&& apt-get install -y --no-install-recommends \
"ca-certificates=*" \
"curl=*" \
"gnupg=*" \
"lsb-release=*" \
&& mkdir -p /etc/apt/keyrings
RUN \
if [ "${NODEJS_VERSION}" = "14" ]; then \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEJS_VERSION}.x $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/nodesource.list; \
else \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEJS_VERSION}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
fi
RUN \
apt-get update > /dev/null \
&& apt-get install -y --no-install-recommends \
"nodejs=*"

# 2. Install git (used to tag commit in benchmark runner)
RUN apt-get -qq install -y git --no-install-recommends
Expand Down
29 changes: 21 additions & 8 deletions .ci/docker/node-puppeteer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ FROM ubuntu:jammy
ARG NODEJS_VERSION

# Install node
RUN apt-get update && apt-get install -y ca-certificates curl gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -sL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODEJS_VERSION.x nodistro main" | \
tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install nodejs -y && \
rm -rf /etc/apt/keyrings && rm /etc/apt/sources.list.d/nodesource.list
RUN \
apt-get update > /dev/null \
&& apt-get install -y --no-install-recommends \
"ca-certificates=*" \
"curl=*" \
"gnupg=*" \
"lsb-release=*" \
&& mkdir -p /etc/apt/keyrings
RUN \
if [ "${NODEJS_VERSION}" = "14" ]; then \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEJS_VERSION}.x $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/nodesource.list; \
else \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEJS_VERSION}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
fi
RUN \
apt-get update > /dev/null \
&& apt-get install -y --no-install-recommends \
"nodejs=*"

# the node-gyp we use is only compatible with Python versions less than 3.10,
# so we need to make sure we use a previous version
Expand Down Expand Up @@ -43,4 +56,4 @@ RUN apt-get install -y wget && \
&& rm -rf /var/lib/apt/lists/*

# Always put COPY instructions at the end, so that Docker will reuse the above layers on builds
COPY run-test.sh /run-test.sh
COPY run-test.sh /run-test.sh

0 comments on commit ad77dd5

Please sign in to comment.