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

Bad root server path after docker containerization. #1366

Closed
Asmau1234 opened this issue Sep 13, 2020 · 3 comments
Closed

Bad root server path after docker containerization. #1366

Asmau1234 opened this issue Sep 13, 2020 · 3 comments
Labels

Comments

@Asmau1234
Copy link

Asmau1234 commented Sep 13, 2020

Expected behaviour

"sbt docker:publishLocal generates a dockerfile without CMD for heroku deployment."

Actual behaviour

when I add

dockerCommands := dockerCommands.value.map {
  case ExecCmd("CMD", _ @ _*) =>
    ExecCmd("CMD", "/opt/docker/bin/myapp")
  case other =>
    other
}

to my build.sbt i can add the CMD command but when i build the app and gives me an error.

"sbt docker:publishLocal fails with: Bad root server path: /opt/docker/bin/myapp"

Information

I am using

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.5")`

sbt.version=1.0.4

I have tried everything but i still can't run the app locally. when i remove the added CMD command tho, it works locally but i cant deploy to heroku.

@muuki88 muuki88 added the docker label Sep 16, 2020
@muuki88
Copy link
Contributor

muuki88 commented Sep 16, 2020

Thanks @Asmau1234 for the detailed issue.

The main problem is that it doesn't work on Heroku, right? What are the error messages when you try to start the image on heroku and what are you trying to solve with the CMD change?

The build fails as the script doesn't exist at this location.

@Asmau1234
Copy link
Author

@muuki88 so i found a solution to it after many hours. After i changed my entry point tho this dockerEntrypoint := Seq("") in my build.sbt it worked out fine and i was able to start the app locally. I don't understand why docker couldn't read my default entrypoint eventho when in the CMD command i call the executable file which is the same path as the default entry point.

@muuki88
Copy link
Contributor

muuki88 commented Sep 16, 2020

Thanks for the update. So this is problem on how heroku starts docker images?

I remember that there's some sort of config file for heroku that tells it how to start stuff. Isn't that the case for docker as well?

@muuki88 muuki88 closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants