I have a Docker file with a base image of 'python:alpine'
I need both python and node.js installed in the container, so I start with a python image.
How do I install the latest version of node.js ('Current latest features' of node.js) in the container without specifying a version?
At the time of this post,
RUN apk -v --no-cache --update add nodejs
will install 'LTS Recommended for most users', and not 'current latest features'
Reference: https://nodejs.org/en
At the time of this post:
- 'LTS recommended for most users': 14.7.6
- 'Current latest features': 16.9.1
In this example, I want to have 16.9.1 installed instead of 14.7.6, but not specify a specific version in my Dockerfile
The purpose of this is to lower the maintenance on the Dockerfile, having it pull the latest 'Current - latest features version' always, without having to check the node.js site for a version number, and hard coding that into the Dockerfile.
See this:
And,
nodejs-current
is the package name for latest feature release, so you could use next:Whole run: