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

Add Setting for Docker User #980

Merged
merged 1 commit into from
May 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ object DockerPlugin extends AutoPlugin {
dockerExposedVolumes := Seq(),
dockerLabels := Map(),
dockerRepository := None,
dockerUsername := None,
dockerAlias := DockerAlias(
dockerRepository.value,
None,
dockerUsername.value,
(packageName in Docker).value,
Some((version in Docker).value)
),
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/com/typesafe/sbt/packager/docker/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ trait DockerKeys {
val dockerExposedUdpPorts = SettingKey[Seq[Int]]("dockerExposedUdpPorts", "UDP Ports exposed by Docker image")
val dockerExposedVolumes = SettingKey[Seq[String]]("dockerExposedVolumes", "Volumes exposed by Docker image")
val dockerRepository = SettingKey[Option[String]]("dockerRepository", "Repository for published Docker image")
val dockerUsername = SettingKey[Option[String]]("dockerUsername", "Username for published Docker image")
val dockerAlias =
SettingKey[DockerAlias]("dockerAlias", "Docker alias for the built image")
val dockerUpdateLatest =
Expand Down
7 changes: 5 additions & 2 deletions src/sphinx/formats/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,18 @@ Publishing Settings
~~~~~~~~~~~~~~~~~~~

``dockerRepository``
The repository to which the image is pushed when the ``docker:publish`` task is run. This should be of the form ``[username]`` (assumes use of the ``index.docker.io`` repository) or ``[repository.host]/[username]``.
The repository to which the image is pushed when the ``docker:publish`` task is run. This should be of the form ``[repository.host[:repository.port]]`` (assumes use of the ``index.docker.io`` repository) or ``[repository.host[:repository.port]][/username]`` (discouraged, but available for backwards compatibilty.).

``dockerUsername``
The username or orgranization to which the image is pushed when the ``docker:publish`` task is run. This should be of the form ``[username]`` or ``[organization]``.

``dockerUpdateLatest``
The flag to automatic update the latest tag when the ``docker:publish`` task is run. Default value is ``FALSE``. In order to use this setting, the minimum docker console version required is 1.10. See https://github.com/sbt/sbt-native-packager/issues/871 for a detailed explanation.

``dockerAlias``
The alias to be used for tagging the resulting image of the Docker build.
The type of the setting key is ``DockerAlias``.
Defaults to ``[dockerRepository/][name]:[version]``.
Defaults to ``[dockerRepository/][dockerUsername/][packageName]:[version]``.

``dockerBuildOptions``
Overrides the default Docker build options.
Expand Down