Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Provide a way to run the base-image as non-root #17

@hoshposh

Description

@hoshposh

Overview

There are numerous guidances about running within a container as non-root. These involve the following approaches that layer security around the running container.

  1. Use the Dockerfile USER directive to specify the default, preferably non-root user that will run the combination of the ENTRYPOINT and CMD commands.
  2. Support the use of the docker run --user=xxx --group=yyy parameters that control which user the container runs as.

This issue is to request either guidance or an approach so that downstream derivatives of the base image can run their commands as non-root.

Notes

  1. During our investigation the initial hurdle to being able to use the USER directive within our derived Dockerfile were the /startup/startup.d scripts that install CA certificates.

  2. There are no existing utilities installed like gosu that provide a way to perform a privilege step-down from root to a non-root user. This might be a way to execute the /startup scripts as root and then run everything else as a non-root user.

    • Derived images could add this utility, but is this the approach that should be followed?
  3. Is an alternative approach to derive a base image after a run of the /startup scripts, so that the image includes the CA certificate changes?

Reference links

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions