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

[docker] name for build tag #295

Closed
rfranco opened this issue Jul 14, 2014 · 5 comments
Closed

[docker] name for build tag #295

rfranco opened this issue Jul 14, 2014 · 5 comments
Assignees
Labels
docker documentation Documentation should be extended or updated

Comments

@rfranco
Copy link
Contributor

rfranco commented Jul 14, 2014

When change name in Docker that changes the entrypoint in Dockerfile too.
Maybe could has a new setting call dockerTag likely as dockerRepository.

@fiadliel
Copy link
Contributor

The entrypoint is changed, because the name of the script generated by sbt-native-packager depends on name (via normalizedName), and the entrypoint points at that script. Having an entry point other than the script is currently not supported (and I'm not sure what kind of API should be exposed). What kind of use case are you thinking of?

The tag name is generated from version in Docker, so you can change the tag by changing that value. e.g. if you want the tag to start with a 'v', you can put this in your build.sbt:

version in Docker := "v" + (version in Docker).value

@rfranco
Copy link
Contributor Author

rfranco commented Jul 15, 2014

My use case is, i have a project with name "foo-api" so the default tag will be foo-api:$version.
But i'd like to be foo/api:$version for that change the name in Docker to "foo/api" then that change the Entrypoint too.
So i think need to have other behavior, i did a workaround and create a new Keys

val dockerTag = SettingKey[Option[String]]("dockerTag", "Tag for build Docker image")

dockerTarget <<= (dockerRepository, dockerTag, normalizedName, version) map {
        (repo, tag, name, version) =>
          repo.map(_ + "/").getOrElse("") + tag.getOrElse(name) + ":" + version
      }

That solve my problem for now.

@fiadliel
Copy link
Contributor

I can see that being useful... I'd like to see what the final result of #250 is, before deciding exactly how it should change.

@muuki88
Copy link
Contributor

muuki88 commented Aug 2, 2014

@rfranco This should be possible now in the next 0.8.0-M1 release.

packageName in Docker := "foo/api"

@muuki88
Copy link
Contributor

muuki88 commented Sep 19, 2014

@rfranco Does this work now for you? If yes, we can close this one.

@muuki88 muuki88 added documentation Documentation should be extended or updated and removed feature request labels Sep 23, 2014
@muuki88 muuki88 self-assigned this Sep 24, 2014
muuki88 added a commit that referenced this issue Sep 25, 2014
FIX #295 Adding documentation for docker tags
muuki88 added a commit that referenced this issue Sep 25, 2014
This reverts commit 31ae087.
Not compatible with 0.7.x stream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker documentation Documentation should be extended or updated
Projects
None yet
Development

No branches or pull requests

3 participants