Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 2297
Alex Hales
  • 0
Alex HalesTeacher
Asked: May 31, 20222022-05-31T21:05:27+00:00 2022-05-31T21:05:27+00:00

docker – SBT Native Packager Not Including Entrypoint

  • 0

[ad_1]

I have a multi module SBT project that I’m using to build a Docker image out of. There is one module that depends on all the other modules and I’m actually trying to build the Docker image for this module. Here is a snippet from my build.sbt

lazy val impute = (project in file(MODULE_NAME_IMPUTE)).dependsOn(core% "compile->compile;test->test", config)
  .settings(
    commonSettings,
    enablingCoverageSettings,
    name := MODULE_NAME_IMPUTE,
    description := "Impute the training data"
  )
  .enablePlugins(JavaAppPackaging, DockerPlugin)

lazy val split = (project in file(MODULE_NAME_SPLIT)).dependsOn(core% "compile->compile;test->test", config)
  .settings(
    commonSettings,
    enablingCoverageSettings,
    dockerSettings("split"),
    name := MODULE_NAME_SPLIT,
    description := "Split the dataset into train and test"
  )
  .enablePlugins(JavaAppPackaging, DockerPlugin)

lazy val run = (project in file(MODULE_NAME_RUN)).dependsOn(core % "compile->compile;test->test", config, cleanse, encode, feature, impute, split)
  .settings(
    commonSettings,
    dockerSettings("run"),
    enablingCoverageSettings,
    name := MODULE_NAME_RUN,
    description := "To run the whole setup as a pipeline locally"
  )
  .enablePlugins(JavaAppPackaging, DockerPlugin)

As you can see, the run module depends on all the other modules and I’m actually trying to build the Docker image for the run module for which I used the following command:

sbt run/docker:publishLocal

This works fine and the Docker image is also built, but when I inspect my Docker image, especially on the ENTRYPOINT, I get to see the following:

        "Entrypoint": [
            "/opt/docker/bin/run"
        ],

But instead, I would have expected to see something like this:

        "Entrypoint": [
            "java",
            "-cp",
            "com.mypackage.housingml.run.Main"
        ],

Is there anything else that I’m missing? Here is my dockerSettings() function from my build.sbt:

def dockerSettings(name: String) = {
  Seq(
    // Always use latest tag
    dockerUpdateLatest := true,

    maintainer  := s"$projectMaintainer",

    // https://hub.docker.com/r/adoptopenjdk/openjdk13
    // Remember to use AshScriptPlugin if you are using an alpine based image
    dockerBaseImage := "adoptopenjdk/openjdk13:alpine-slim",

    // If you want to publish to a remote docker repository, uncomment the following:
    //dockerRepository := Some("remote-docker-hostname"),
    Docker / packageName := s"joesan/$projectName-$name",

    // If we're running in a docker container, then export logging volume.
    Docker / defaultLinuxLogsLocation := "/opt/docker/logs",
    dockerExposedVolumes := Seq((Docker / defaultLinuxLogsLocation).value),
    dockerEnvVars := Map(
      "LOG_DIR" -> (Docker / defaultLinuxLogsLocation).value,
    )
  )
}

[ad_2]

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 4800 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 1063 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 1010 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.