I am trying to install NodeJS on a Docker CentOs: Below is my dockerfile:
FROM centos:7.3.1611
ADD https://rpm.nodesource.com/setup_8.x /root/
#RUN curl -sL https://rpm.nodesource.com/setup_8.x
RUN bash /root/setup_8.x ;\
yum -y install nodejs ;\
yum -y install java-1.8.0-openjdk
#removed the rest of code
And I use below to build the container:
docker-compose build --no-cache
The output is as below:
Building test
Step 1/3 : FROM centos:7.3.1611
---> 67591570dd29
Step 2/3 : ADD https://rpm.nodesource.com/setup_8.x /root/
---> 92d4f540a9e8
Removing intermediate container d4cef3605bdd
Step 3/3 : RUN bash /root/setup_8.x ; yum -y install nodejs ; yum -y install java-1.8.0-openjdk
---> Running in 2c331b5211c7
## Installing the NodeSource Node.js 8.x repo...
## Inspecting system...
+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m
## Confirming "el7-x86_64" is supported...
+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_8.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'
## Your distribution, identified as "centos-release-7-3.1611.el7.centos.x86_64", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support
It seems the issue is ‘exec_cmd_nobail "curl -sLf -o /dev/null '${RELEASE_URL}'’ in the setup script returns non-zero output, any hint? The issue was not seen like a week ago when I tried, I guess a change in the Docker Centos image?
=======================
- Resolved! The answers are in the comments. Thanks!
centos:7.2.1511
image?RUN curl -SsL https://rpm.nodesource.com/setup_8.x | bash
instead. Also delete the existing centos images and pull them again