-
Notifications
You must be signed in to change notification settings - Fork 445
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
Add Docker labels easily #962
Conversation
ef2571a
to
64adbbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your pull request. Feature and implementation look solid to me.
Could you add a small test, setting some labels that ensure that the docker command still runs?
You can find the tests here:
https://github.com/sbt/sbt-native-packager/tree/master/src/sbt-test/docker
You can find some docs on how to run the tests in the Developer Guide
Also +1 for the documentation :)
makeExposePorts(dockerExposedPorts.value, dockerExposedUdpPorts.value) ++ | ||
makeVolumes(dockerExposedVolumes.value, user, group) ++ | ||
Seq(makeUser(user), makeEntrypoint(dockerEntrypoint.value), makeCmd(dockerCmd.value)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look like formatting changes. When you run sbt scalafmt
it should format correctly.
Or if you use intellij along with the scalafmt
plugin you may use a newer or older version.
4ef3288
to
78e8834
Compare
I had forgotten about a test :) I ran |
Thanks a lot :) |
This change allows for an easy way to add labels to Docker images.
It was previously possible to add this as custom commands but given the importance of labels, it seems reasonable to make adding them more easily.
I believe there is not much documentation necessary. I added a reference to the settings key.
As an example, we will be using this to forward Jenkins job variables into our Docker images.