You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In py3_image from rules_docker, the default workdir and entrypoints are properly set to reasonable values. Can we do the same in oci_python_image rule? something like:
@@ -1,6 +1,7 @@
"Wrapper macro to make three separate layers for python applications"
load("@aspect_bazel_lib//lib:tar.bzl", "mtree_spec", "tar")
+load("@aspect_bazel_lib//lib:utils.bzl", "utils")
load("@rules_oci//oci:defs.bzl", "oci_image")
# match *only* external repositories that have the string "python"
@@ -74,6 +75,12 @@ def py_layers(name, binary):
def py_oci_image(name, binary, tars = [], **kwargs):
"Wrapper around oci_image that splits the py_binary into layers."
+
+ if "entrypoint" not in kwargs:
+ kwargs["entrypoint"] = ["/" + utils.to_label(binary).package + "/" + utils.to_label(binary).name]
+ if "workdir" not in kwargs:
+ kwargs["workdir"] = "/" + utils.to_label(binary).package + "/" + utils.to_label(binary).name + ".runfiles/__main__"
+
oci_image(
name = name,
tars = tars + py_layers(name, binary),
The text was updated successfully, but these errors were encountered:
What is the current behavior?
No response
Describe the feature
In py3_image from rules_docker, the default workdir and entrypoints are properly set to reasonable values. Can we do the same in oci_python_image rule? something like:
The text was updated successfully, but these errors were encountered: