Skip to content

Commit 15114dc

Browse files
committed
Enables set different Node versions in Testkit Dockerfile
This change enables testing the driver using different NodeJS versions.
1 parent 87b0851 commit 15114dc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

testkit/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@ FROM ubuntu:20.04
22

33
ENV DEBIAN_FRONTEND noninteractive
44
ENV NODE_OPTIONS --max_old_space_size=4096
5+
SHELL ["/bin/bash", "--login", "-c"]
56

67
RUN apt-get update && \
78
apt-get install -y \
89
git \
910
curl \
1011
python3 \
11-
nodejs \
12-
npm \
1312
firefox \
1413
&& rm -rf /var/lib/apt/lists/*
1514

16-
RUN npm install -g npm@7 \
17-
&& /bin/bash -c "hash -d npm"
18-
1915
# Enable tls v1.0
2016
RUN echo "openssl_conf = openssl_configuration\n"|cat - /etc/ssl/openssl.cnf > /tmp/openssl_conf.cnf \
2117
&& mv /tmp/openssl_conf.cnf /etc/ssl/openssl.cnf
@@ -41,4 +37,11 @@ USER driver
4137
WORKDIR /home/driver
4238
CMD /bin/bash
4339
RUN mkdir /home/driver/.npm_global
40+
41+
# Configuring NodeJS version
42+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
43+
RUN nvm install ${NODE_VERSION:=10}
44+
RUN nvm use ${NODE_VERSION:=10}
45+
46+
# Confiugure home directory
4447
RUN npm config set prefix /home/driver/.npm_global

0 commit comments

Comments
 (0)