Skip to content

Node-RED Dockerfile question/optimization #794

@segaura

Description

@segaura

In Node-RED Dockerfile, what is the point of installing apk packages (switching temporarily to root user)?

Isn't it simpler to stay non-root and simply do an npm install like Node-RED docker project suggests to?

Building Custom Image
Creating a new Docker image, using the public Node-RED images as the base image, allows you to install extra nodes during the build process.

This Dockerfile builds a custom Node-RED image with the flightaware module installed from NPM.

FROM nodered/node-red
RUN npm install node-red-contrib-flightaware

docker-compose.yml already has the EXTRA_PACKAGES ARG to work with

args:
- DOCKERHUB_TAG=latest
- EXTRA_PACKAGES=node-red-configurable-ping node-red-contrib-boolean-logic node-red-contrib-influxdb node-red-dashboard node-r...

So Dockerfile only needs

RUN npm install ${EXTRA_PACKAGES}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions