Skip to content

Commit

Permalink
Docker image creation method was unnecessary returning tuples. This c…
Browse files Browse the repository at this point in the history
…ommit removes tuples
  • Loading branch information
Michal Bogacz committed Nov 21, 2024
1 parent c20d855 commit a84788f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/oci.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load", "oci_push")
load("@rules_pkg//:pkg.bzl", "pkg_tar")

def docker_image(application_name, main_class, deps = [], additional_jvm_opts = []):
return scala_binary(
scala_binary(
name = "app",
main_class = main_class,
deps = deps,
), pkg_tar(
)
pkg_tar(
name = "app_layer",
srcs = [":app_deploy.jar"],
), oci_image(
)
oci_image(
name = "image",
base = "@java_temurin",
entrypoint = [
Expand All @@ -20,11 +22,13 @@ def docker_image(application_name, main_class, deps = [], additional_jvm_opts =
"/app_deploy.jar",
],
tars = [":app_layer"],
), oci_load(
)
oci_load(
name = "local_image",
image = ":image",
repo_tags = ["{app}:latest".format(app = application_name)],
), oci_push(
)
oci_push(
name = "push",
image = ":image",
repository = "docker.io/" + application_name,
Expand Down

0 comments on commit a84788f

Please sign in to comment.