Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile Node.JS installation script deprecated #437

Open
StuBlad opened this issue Dec 18, 2023 · 3 comments
Open

Dockerfile Node.JS installation script deprecated #437

StuBlad opened this issue Dec 18, 2023 · 3 comments

Comments

@StuBlad
Copy link
Contributor

StuBlad commented Dec 18, 2023

When attempting to setup a fresh NeoHabitat instance using Docker, the build fails when you get to the part where we attempt to install Node.JS.

This line from the Dockerfile in particular is where it will die:
curl -fsSL https://rpm.nodesource.com/setup_18.x | bash -

When you run this command, you'll get this output:

================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================
                           SCRIPT DEPRECATION WARNING                    
  
  This script, located at https://deb.nodesource.com/setup_X, used to
  install Node.js is deprecated now and will eventually be made inactive.
  Please visit the NodeSource distributions Github and follow the
  instructions to migrate your repo.
  https://github.com/nodesource/distributions
  The NodeSource Node.js Linux distributions GitHub repository contains
  information about which versions of Node.js and which Linux distributions
  are supported and how to install it.
  https://github.com/nodesource/distributions
                          SCRIPT DEPRECATION WARNING
================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================
TO AVOID THIS WAIT MIGRATE THE SCRIPT
Continuing in 60 seconds (press Ctrl-C to abort) ...

If you head to the NodeSource distribution Github repo as mentioned above, you'll see the instructions for installing via this method have changed to the following commands:

curl -SLO https://rpm.nodesource.com/nsolid_setup_rpm.sh
chmod 500 nsolid_setup_rpm.sh
./nsolid_setup_rpm.sh 18
yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1

This command is meant to install Node.JS version 18.

If you add this into the Dockerfile by commenting the original line out and prefixing each of the above lines with RUN, the Docker compose setup will continue on past the point of failure and begin to install the base build dependencies on the next line of the Dockerfile.

However, it gets to the following line and then stalls to infinity and I cannot get it to proceed past this point:

 => [neohabitat  5/15] RUN yum -y install   cronie   git   java-1.8.0-openjdk   make   mariadb   vim   wget   which   maven   mongodb-o  126.5s
 => => # Running transaction check
 => => # Transaction check succeeded.
 => => # Running transaction test
 => => # Transaction test succeeded.
 => => # Running transaction
 => => #   Running scriptlet: npm-1:6.14.10-1.10.23.1.1.module_el8.4.0+645+9ce14ba   1/1
@frandallfarmer
Copy link
Owner

NOTE: As of today, if you just wait the 60 seconds the build will proceed and, in my case, complete successfully.

This issue is staying open because it DOES need to be addressed.

@AmandaJonesAway
Copy link
Contributor

If you add this into the Dockerfile by commenting the original line out and prefixing each of the above lines with RUN, the Docker compose setup will continue

This doesn't work. Each RUN is counted as a separate process. Just replace the original curl with the new commands, but terminate each line with \ and put && at the start of the next line. This keeps each line within the same process. (I'm not able to test this at the moment, as I'm away from home, but that is probably all it needs.)

@StuBlad
Copy link
Contributor Author

StuBlad commented Dec 19, 2023

I changed the Dockerfile to this:

# Get a recent version of nodejs
# RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash -
RUN curl -SLO https://rpm.nodesource.com/nsolid_setup_rpm.sh \ 
&& chmod 500 nsolid_setup_rpm.sh \ 
&& ./nsolid_setup_rpm.sh 18 \ 
&& yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1

It performed the same way as doing the RUN on each line and for my own WSL2 setup, still hangs on the line:

 => => # Running transaction check
 => => # Transaction check succeeded.
 => => # Running transaction test
 => => # Transaction test succeeded.
 => => # Running transaction
 => => #   Running scriptlet: npm-1:6.14.10-1.10.23.1.1.module_el8.4.0+645+9ce14ba   1/1

If anyone else who sees this is able to try this on a non WSL2 machine, please let us know if it does this for you too.

jeremypenner added a commit to jeremypenner/neohabitat that referenced this issue Jan 27, 2024
Addresses frandallfarmer#437.

NodeSource has reinstated the deprecated installer scripts, but the NodeSource repo doesn't contain a packge for npm, and the CentOS package for npm conflicts with the NodeSource nodejs. Updated to use the nsolid package directly.

Also updated the habibots Dockerfile to use the latest node 18 image. Debian Bookworm transitioned the netcat package from one that installed netcat-openbsd to a "virtual package" which doesn't specify a preferred version. Changed it to specify netcat-openbsd explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants