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

**URL:** <https://discourse.nodered.org/t/docker-container-does-not-contain-the-sudo-image-but-i-need-it/76657>\
**Category:** General\
**Tags:** docker\
**Created:** [17 March 2023 10:24 UTC](https://discourse.nodered.org/t/docker-container-does-not-contain-the-sudo-image-but-i-need-it/76657 "2023-03-17T10:24:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwims](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bwims/32/64907_2.png) [@bwims](https://discourse.nodered.org/u/bwims)\
**Post date:** [17 March 2023 10:24 UTC](https://discourse.nodered.org/t/docker-container-does-not-contain-the-sudo-image-but-i-need-it/76657/1 "2023-03-17T10:24:39Z")

</div>

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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 March 2023 10:37 UTC](https://discourse.nodered.org/t/docker-container-does-not-contain-the-sudo-image-but-i-need-it/76657/2 "2023-03-17T10:37:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [31 March 2023 10:37 UTC](https://discourse.nodered.org/t/docker-container-does-not-contain-the-sudo-image-but-i-need-it/76657/3 "2023-03-31T10:37:30Z")

</div>

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