Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chown values overrides for Docker format #1400

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

arixmkii
Copy link

Fixes #1399

SettingKeys are added under Docker specific trait. I also added basic documentation about them being available.

@lightbend-cla-validator

Hi @arixmkii,

Thank you for your contribution! We really value the time you've taken to put this together.

Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:

https://www.lightbend.com/contribute/cla

@muuki88 muuki88 added docker minor release drafter version labels Feb 21, 2021
Copy link
Contributor

@muuki88 muuki88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @arixmkii for your contributions ❤️

I suggested a few changes. If possible it would be nice to have a sbt scripted test that show's this feature in action.

Comment on lines +71 to +74
val chownUser =
SettingKey[Option[String]]("chown-user", "Optional alternative user to use in chown in COPY command")
val chownGroup =
SettingKey[Option[String]]("chown-group", "Optional alternative group to use in chown in COPY command")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val chownUser =
SettingKey[Option[String]]("chown-user", "Optional alternative user to use in chown in COPY command")
val chownGroup =
SettingKey[Option[String]]("chown-group", "Optional alternative group to use in chown in COPY command")
val dockerChownUser =
SettingKey[Option[String]]("docker-chown-user", "Optional alternative user to use in chown in COPY command")
val dockerChownGroup =
SettingKey[Option[String]]("docker-chown-group", "Optional alternative group to use in chown in COPY command")

If the setting is specific to a packaging format it's prefixed with that format. In this case docker<SettingKey>. The configuration scoping is not necessary, so you can move it in the plugins definition to the other settings starting with docker.

@@ -99,6 +99,12 @@ Environment Settings
``daemonUser in Docker``
The user to use when executing the application. Files below the install path also have their ownership set to this user.

``chownUser in Docker``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``chownUser in Docker``
``dockerChownUser``

``chownUser in Docker``
Optionally overrides user value used for applying to ``chown`` in ``COPY`` commands.

``chownGroup in Docker``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``chownGroup in Docker``
``dockerChownGroup``

Comment on lines +315 to +316
chownUser := None,
chownGroup := None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
chownUser := None,
chownGroup := None,
dockerChownUser := None,
dockerChownGroup := None,

See comment in the Keys.scala.

Also move up to the settings starting with docker*

@arixmkii
Copy link
Author

@muuki88 Thank you for detailed feedback! I will update this PR on Thursday.

@muuki88
Copy link
Contributor

muuki88 commented Feb 23, 2021

Looking forward 🐱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker minor release drafter version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow override chown user and group in copy commands
3 participants