Skip to content

docker: don't run executable as root - #378

Merged
Bios-Marcel merged 3 commits into
scribble-rs:masterfrom
Bixilon:hardenize-docker
Sep 19, 2025
Merged

Bios-Marcel merged 3 commits into
scribble-rs:masterfrom
Bixilon:hardenize-docker

Conversation

@Bixilon

@Bixilon Bixilon commented Sep 19, 2025

Copy link
Copy Markdown
Contributor

It runs them as user and group 248, just a random numer that I mostly use for my docker users.

(just as note for others, I am also setting the following security compose settings):

    read_only: true
    user: "248:248"
    cap_drop: ["ALL"]
    cap_add: ["NET_BIND_SERVICE"] # not needed if running on port 8080

It runs them as user and group 248, just a random numer that I mostly use for my docker users.
Comment thread fly.Dockerfile Outdated
Comment thread linux.Dockerfile Outdated
@Bios-Marcel

Copy link
Copy Markdown
Member

LGTM, just added this comment for myself after understanding how this works 😁

@Bios-Marcel
Bios-Marcel merged commit ba9a13d into scribble-rs:master Sep 19, 2025
3 checks passed
@Bixilon

Bixilon commented Sep 19, 2025

Copy link
Copy Markdown
Contributor Author

Linux doesn't care that there's no user for it.

Kind of a naive comment, afaik there is no such thing as a user in linux, there are just uid and gid. Afaik the user is coming from /etc/passwd, but that is distribution dependent. This image is FROM scratch.

But yah :)

@Bios-Marcel

Copy link
Copy Markdown
Member

Yeah, its more for myself, the technical details dont matter 😁

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.

2 participants