Skip to content

Commit 5604a33

Browse files
committed
Installing node direct from url
1 parent 8c8140d commit 5604a33

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

testkit/Dockerfile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ FROM ubuntu:20.04
33
ENV DEBIAN_FRONTEND noninteractive
44
ENV NODE_OPTIONS --max_old_space_size=4096
55

6-
# Set bash as the shell
7-
SHELL ["/bin/bash", "--login", "-c"]
8-
9-
# REPLACE shell with bash
10-
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
11-
12-
136
RUN apt-get update && \
147
apt-get install -y \
158
git \
@@ -40,14 +33,14 @@ RUN useradd -m driver && echo "driver:driver" | chpasswd && adduser driver sudo
4033
VOLUME /driver
4134
RUN chown -Rh driver:driver /driver
4235
RUN chown -Rh driver:driver /home/driver
43-
USER driver
4436
WORKDIR /home/driver
4537

4638
# Configuring NodeJS version
47-
ENV NVM_DIR /home/driver/.nvm
48-
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
49-
RUN nvm install ${NODE_VERSION:=10}
50-
RUN nvm alias default ${NODE_VERSION:=10}
51-
RUN nvm use default
52-
RUN hash -d npm
53-
RUN echo "source /home/driver/.nvm/nvm.sh" >> /home/driver/.bashrc
39+
RUN apt-get clean
40+
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION:=12}.x | sh
41+
RUN apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
42+
43+
USER driver
44+
45+
RUN node --version
46+
RUN npm --version

testkit/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def is_enabled(value):
2323
def run(args, env=None, cwd=None, check=True):
2424
cmd = ["/bin/bash", "--login", "-c", " ".join(args)]
2525
subprocess.run(
26-
cmd, universal_newlines=True, stderr=sys.stderr, stdout=sys.stdout,
26+
args, universal_newlines=True, stderr=sys.stderr, stdout=sys.stdout,
2727
check=check, env=env, cwd=cwd)
2828

2929

@@ -39,7 +39,7 @@ def run_in_driver_repo(args, env=None, check=True):
3939

4040
def open_proccess_in_driver_repo(args, env=None):
4141
cmd = ["/bin/bash", "--login", "-c", " ".join(args)]
42-
return subprocess.Popen(cmd, cwd=DRIVER_REPO, env=env, stderr=sys.stderr,
42+
return subprocess.Popen(args, cwd=DRIVER_REPO, env=env, stderr=sys.stderr,
4343
stdout=sys.stdout)
4444

4545

0 commit comments

Comments
 (0)