Skip to content

Allow override chown user and group in copy commands #1399

Description

@arixmkii

Would be nice to have an option to use different user and group applied during COPY step. Same effect could be achieved if explicit chown command added, but it will create a new layer.

Why it could be useful. To apply hardening - to make copied files write protected by the user, which will run application (and so that it would not possible to change it by using chmod with the same user).

Currently we apply this via rewriting commands using map/flatMap, which is not really handy.

Proposal - add 2 more settings chownUser and chownGroup both Option[String], and if they are set to Some value, then it will be used and in case of missing value it will fall back to daemonUser and daemonGroup respectively.

We need this applied for multistage docker, but I guess it is better to add the same logic to ChownCopy as well.

I will sketch a PR for this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions