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
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