Skip to content

Docker: Only switch user if the current user is root#7654

Merged
fab-10 merged 4 commits intohyperledger:mainfrom
skylenet:patch-1
Sep 23, 2024
Merged

Docker: Only switch user if the current user is root#7654
fab-10 merged 4 commits intohyperledger:mainfrom
skylenet:patch-1

Conversation

@skylenet
Copy link
Contributor

One might be running the container without root (e.g. docker run --user youruser ... ), if that's the case you'll get an error like this when running su:

Password: su: Authentication failure

…nning as root

Signed-off-by: Rafael Matias <rafael@skyle.net>
Signed-off-by: Rafael Matias <rafael@skyle.net>
@fab-10 fab-10 enabled auto-merge (squash) September 23, 2024 09:25
@fab-10 fab-10 merged commit 0d63955 into hyperledger:main Sep 23, 2024
Wolmin pushed a commit to lukso-network/network-besu that referenced this pull request Sep 27, 2024
* Update entrypoint script for Dockerfile to only switch user if its running as root

Signed-off-by: Rafael Matias <rafael@skyle.net>

* make root user check at the beginning

Signed-off-by: Rafael Matias <rafael@skyle.net>

---------

Signed-off-by: Rafael Matias <rafael@skyle.net>
Signed-off-by: Wolmin <lamonos123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants