Skip to content

Commit 9544a33

Browse files
committed
Stealing from PR #186
1 parent 59265a8 commit 9544a33

File tree

3 files changed

+27
-30
lines changed

3 files changed

+27
-30
lines changed

packagingenv/Dockerfile.template

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,41 @@ RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash -
99

1010
{%- if version in ('centos8', 'rockylinux8') %}
1111

12-
# Install development tools
13-
RUN yum -y module install nodejs:10
12+
# Install node
13+
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \
14+
source ~/.bashrc && \
15+
nvm install 20.8.1 && \
16+
node -v && npm -v
1417

1518
# Install python3 for gyp
1619
RUN yum -y install python3
1720

1821
# Upgrade gyp to a python3 compatible version
19-
RUN npm install -g node-gyp@latest
22+
RUN source ~/.bashrc && nvm use 20.8.1 && npm install -g node-gyp@latest
2023

2124
{%- endif %}
2225

23-
# Install development tools
24-
RUN yum -y install nodejs
26+
# Install node
27+
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \
28+
source ~/.bashrc && \
29+
nvm install 20.8.1 && \
30+
node -v && npm -v
2531

2632
{% else -%}
2733

2834
# Install prerequisites
2935
RUN apt-get update && \
3036
DEBIAN_FRONTEND=noninteractive apt-get -y install \
31-
build-essential curl gnupg devscripts debhelper dh-make git libicu-dev
37+
build-essential curl gnupg devscripts debhelper dh-make git libicu-dev curl
3238

3339
{%- if version in ('focal') %}
3440
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd
3541
{% endif %}
3642

37-
# Add NodeSource repo
38-
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
39-
40-
# Install node
41-
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs
42-
43-
RUN apt-get clean
43+
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - && \
44+
. ~/.bashrc && \
45+
nvm install 20.8.1 && \
46+
node -v && npm -v
4447

4548
{% endif -%}
4649

packagingenv/focal/Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ FROM ubuntu:focal
33
# Install prerequisites
44
RUN apt-get update && \
55
DEBIAN_FRONTEND=noninteractive apt-get -y install \
6-
build-essential curl gnupg devscripts debhelper dh-make git libicu-dev
6+
build-essential curl gnupg devscripts debhelper dh-make git libicu-dev curl
77
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install dh-systemd
88

99

10-
# Add NodeSource repo
11-
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
12-
13-
# Install node
14-
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install nodejs
15-
16-
RUN apt-get clean
10+
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash - && \
11+
. ~/.bashrc && \
12+
nvm install 20.8.1 && \
13+
node -v && npm -v
1714

1815
COPY docker-entrypoint.sh /entrypoint.sh
1916
ENTRYPOINT [ "/entrypoint.sh" ]

packagingenv/rockylinux8/Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@ FROM rockylinux:8
22

33
RUN yum -y install gcc-c++ make git libicu-devel rpmdevtools
44

5-
# Add NodeSource repo
6-
RUN curl --silent --location https://rpm.nodesource.com/setup_20.x | bash -
7-
8-
# Install development tools
9-
RUN yum -y module install nodejs:20
5+
# Install node
6+
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && \
7+
source ~/.bashrc && \
8+
nvm install 20.8.1 && \
9+
node -v && npm -v
1010

1111
# Install python3 for gyp
1212
RUN yum -y install python3
1313

1414
# Upgrade gyp to a python3 compatible version
15-
RUN npm install -g node-gyp@latest
16-
17-
# Install development tools
18-
RUN yum -y install nodejs
15+
RUN source ~/.bashrc && nvm use 20.8.1 && npm install -g node-gyp@latest
1916

2017
COPY docker-entrypoint.sh /entrypoint.sh
2118
ENTRYPOINT [ "/entrypoint.sh" ]

0 commit comments

Comments
 (0)