SensorsIot / IOTstack

Docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.44k stars 304 forks source link

20220708 Node-RED - master branch - PR 1 of 2 #590

Closed Paraphraser closed 1 year ago

Paraphraser commented 2 years ago

Adopts build-argument syntax in the template service definition + template Dockerfile to pass an image tag plus an optional list of extra packages to the Dockerfile at build time.

Pinning to a specific base image can now be accomplished in the Compose file. This places Node-RED on equal footing with containers that do not use local Dockerfiles (and Mosquitto which already has similar build-argument syntax).

Together, the changes mean user customisations to the first part of the Dockerfile are no longer at risk of being overwritten by menu runs to change the list of add-on nodes.

For any given IOTstack installation, there is some possibility of a hybrid result, depending on how and when the user runs the menu, or which techniques each user employs to manage their Compose file and Node-RED Dockerfile. The intention is to either fail safe or at least fail sensibly:

Worst case is an existing user adopting all-new syntax without realising the old Dockerfile specified latest-12, thereby advancing to node.js 14.x unexpectedly, perhaps also losing additional packages along the way. The fix is to specify DOCKERHUB_TAG=latest-12, append any lost packages to EXTRA_PACKAGES=, and rebuild.

Personally, I switched to -14 a good six months ago. It worked out-of-the-box with zero migration issues and I've never looked back. While that's only n=1, I don't feel there's sufficient risk to warrant IOTstack continuing to default to -12. We have to change sometime, or we'll be back where we were when images based on -10 were no longer being offered as Node-RED marched forward.

Using node.js version 14 is the implicit recommendation (ie latest and latest-14 are currently synonyms). Version 16 is available but is known to throw up some migration issues. IOTstack started defaulting to version 12 in March 2021 (when version 10 was deprecated).

Signed-off-by: Phill Kelley 34226495+Paraphraser@users.noreply.github.com