Docker container does not contain the SUDO image but I need it

Hi, I have a need to use the Exec node excute a sudo command. However, the Docker image is created without the SUDO command.

I would guess that nearly all Node red installations directly Linux / Raspbian etc would have access to sudo.

I was going to raise it as an issue in Github, but I thought I would ask for opinions first.

Please, rather than ask what I want to use sudo for, can we focus on the general principle that there may well be a case when only a sudo command can achieve what is required. Why create a docker container for an unprivileged account running Node Red without the sudo command?

Incidentally, there is an "SU" command, but whenever I try to execute it, it says:
su: must be suid to work properly

However, all bits are set on the su executable.

bash-5.1# ls /bin/su -l
lrwxrwxrwx    1 root     root            12 Jul 18 16:36 /bin/su -> /bin/busybox

I'd be grateful for any advice!

B.

you are correct - Alpine does not ship with sudo by default - if you need it you will need to rebuild the container and add in the su-exec package RUN set -ex && apk --no-cache add sudo .
The general principle is that you do not need sudo so I don't think we will want to add it to the default image as it opens up more possibilities for security vulnerabilities.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.