1

I want to convert an application that currently runs with docker to boxfuse.

After the maven build, I have these relevant files:

/target/my-app-shaded.jar
/config-dev.yml

The command to run the jar locally would be simply jar -jar target/my-app-shaded.jar server config-dev.yml

What I could figure out is that boxfuse run target/my-app-shaded.jar runs the jar file, but how do I add the config file and the command line arguments?

Jan
  • 2,803
  • 6
  • 36
  • 57

1 Answers1

1

This seems to be a Dropwizard application. In that case you can simply place your configuration under src/main/resources and pass the arguments like this

boxfuse run target/my-app-shaded.jar "-jvm.main.args=server config-dev.yml"

When executing this at the root of your Maven or Gradle project and using the latest Boxfuse Client (you can simply update with boxfuse -u), you can also simplify this to:

boxfuse run "-jvm.main.args=server config-dev.yml"

As Boxfuse will auto-discover the payload.

Also if you name your config file boxfuse.yml you can simply this even further to:

boxfuse run

More info: https://cloudcaptain.sh/docs/payloads/dropwizard#configuration

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137
  • 1
    Actually it is but an older 0.6.5 which isn't supported by boxfuse. What would be the manual fat-jar way? (I'm eager to learn details). It might be that the old dropwizard version doesn't support reading from classpath but i might be wrong (never did that) – Jan Feb 02 '16 at 17:41
  • 1
    For manual fat-jars you have to package the config in the fat-jar and then you have 2 options: load the config programmatically from the classpath (this may help: https://github.com/dropwizard/dropwizard/issues/409) or extract it manually on disk on startup and load it as a file. – Axel Fontaine Feb 02 '16 at 18:32