Skip to content

Instantly share code, notes, and snippets.

@maxandersen
Created September 4, 2020 11:09
Show Gist options
  • Save maxandersen/1d3ccaa67c911eff75205f0eccf2c69d to your computer and use it in GitHub Desktop.
Save maxandersen/1d3ccaa67c911eff75205f0eccf2c69d to your computer and use it in GitHub Desktop.
minimal build of container image with jbang and quarkus

Run this with jbang -Dquarkus.container-image.build=true build quarkus.java and it builds a docker image.

Requires just jbang 0.43+ installed (java will be downloaded automatically as needed)

//usr/bin/env jbang "$0" "$@" ; exit $?
/**
* Run this with `jbang -Dquarkus.container-image.build=true build quarkusjib.java`
* and it builds a docker image.
*/
//DEPS io.quarkus:quarkus-resteasy:1.8.0.CR1
//DEPS io.quarkus:quarkus-container-image-jib:1.8.0.CR1
//JAVA_OPTIONS -Djava.util.logging.manager=org.jboss.logmanager.LogManager
//Q:CONFIG quarkus.container-image.name=quarkusjbangdemo
import io.quarkus.runtime.Quarkus;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@Path("/hello")
@ApplicationScoped
public class quarkusjib {
@GET
public String sayHello() {
return "hello from Quarkus with jbang.dev";
}
public static void main(String[] args) {
Quarkus.run(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment