Skip to content

RFE: dockerfiles: use non-root runtime user for safer container usage #92

Description

@cuiyingd

Summary

The Dockerfiles under the dockerfiles directory currently run containers as _root by default. Any container without an explicit USER instruction will run as root. Running dexbotic containers as root introduces security risks, making it unsuitable for shared GPU clusters, production deployments and CI environments. Files created on mounted host volumes will be owned by root, which causes permission issues.

Proposed Change

Add a dedicated non-root user and group (e.g. dexbotic) in the Dockerfiles.
Set proper ownership for relevant directories including /opt/dexbotic and /opt/rlinf.
Insert the USER dexbotic directive before CMD or ENTRYPOINT.
Retain root privileges only for build-time installation steps.

Example:
dockerfile
RUN groupadd -r dexbotic && useradd -r -g dexbotic -m dexbotic
RUN chown -R dexbotic:dexbotic /opt/dexbotic /opt/rlinf
USER dexbotic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions