You may have read our update on Node.js 22 earlier in the year. Even though it does not go LTS in mid October and Red Hat only supports LTS versions you may be thinking about how you can test it out in the Red Hat Enterprise Linux (RHEL) ecosystem in advance.
To help you prepare and do advance testing, the RHEL team has made available some pre-built Node.js images based on centos stream 9. These are available as :
These images will include an non-LTS version of Node.js 22, but they will let you test/out prepare for the LTS release of Node.js in RHEL near the end of the year.
This is an example of using them in a container file:
# First stage of the build is to install dependencies, and build from source
FROM quay.io/sclorg/nodejs-22-c9s as build
WORKDIR /usr/src/app
COPY --chown=1001:1001 package*.json ./
RUN npm ci
COPY --chown=1001:1001 tsconfig*.json ./
COPY --chown=1001:1001 src src
RUN npm run build:ts
# Second stage of the build is to create a lighter container with just enough
# required to run the application, i.e production deps and compiled js files
FROM quay.io/sclorg/nodejs-22-minimal-c9s
WORKDIR /usr/src/app
COPY --chown=1001:1001 --from=build /usr/src/app/package*.json/ .
RUN npm ci --omit=dev
COPY --chown=1001:1001 --from=build /usr/src/app/dist/ dist/
ENV NODE_ENV=production
ENV FASTIFY_PORT 8080
ENV FASTIFY_ADDRESS 0.0.0.0
EXPOSE 8080
ENTRYPOINT [ "./node_modules/.bin/fastify" ]
CMD [ "start", "-l", "info", "dist/app.js" ]
If you want more info about where we got that example and how to use it check out Build lean Node.js container images with UBI and Podman.
I hope this was useful and helps you do some advance testing. To learn more about what Red Hat is up to on the Node.js front, check out our Node.js page.