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

Presense of several main classes breaks docker:publishLocal #636

Closed
unoexperto opened this issue Aug 1, 2015 · 5 comments
Closed

Presense of several main classes breaks docker:publishLocal #636

unoexperto opened this issue Aug 1, 2015 · 5 comments
Labels
feature request universal Zip, tar.gz, tgz and bash issues

Comments

@unoexperto
Copy link

There are several subtle bugs in docker packager. I'll start with this issue first.

Presense of several main classes breaks docker:publishLocal.

Output directory /target/docker/stage/opt doesn't have bin directory with execution script. Example build.scala is here: https://github.com/cppexpert/sbt-docker-example/blob/eaf729a352a667c4637fb800fd6a90725b773235/project/build.scala

@unoexperto
Copy link
Author

So... after 2 hours of debugging I came to solution that specifying main class in Compile package fixes the issue

      mainClass in Compile := Some("AnotherMain"),

It would be nice to sbt-native-packager to either prompt to choose main class or to fail with error instead of producing non-working docker image.

Thanks !

@muuki88
Copy link
Contributor

muuki88 commented Aug 2, 2015

This is a general thing with SBT. If there are multiple main classes then the 'mainClass in CompileisNone` because there is no way to determine the "right" main class.

However a warning would be a nice addition. I keep this issue as a feature request.

@muuki88 muuki88 added feature request universal Zip, tar.gz, tgz and bash issues labels Aug 2, 2015
@unoexperto
Copy link
Author

I think missing "bin" folder in produced docker image is a bug. It should not produce it at all if it cannot determine main class.

@muuki88 muuki88 closed this as completed Mar 20, 2016
@unoexperto
Copy link
Author

Is it fixed ?

@muuki88
Copy link
Contributor

muuki88 commented Mar 30, 2016

Nope, there isn't a warning yet. But there is another ticket where this issue fits in nicely: #633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

2 participants