File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
examples/bzlmod/multi-platform Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ load ("@aspect_bazel_lib//lib:transitions.bzl" , "platform_transition_filegroup" )
12load ("@aspect_rules_py//py:defs.bzl" , "py_image_layer" )
23load ("@rules_oci//oci:defs.bzl" , "oci_image" , "oci_load" )
34load ("@rules_python//python:defs.bzl" , "py_binary" )
@@ -19,7 +20,7 @@ py_binary(
1920)
2021
2122oci_image (
22- name = "main_image " ,
23+ name = "_main_image " ,
2324 base = "@docker_io_python" ,
2425 entrypoint = ["/app/main" ],
2526 tars = py_image_layer (
@@ -29,6 +30,20 @@ oci_image(
2930 ),
3031)
3132
33+ platform_transition_filegroup (
34+ name = "main_image" ,
35+ srcs = [":_main_image" ],
36+ target_platform = select ({
37+ "@platforms//cpu:arm64" : "//platforms:linux_arm64" ,
38+ "@platforms//cpu:x86_64" : "//platforms:linux_x86_64" ,
39+ }),
40+ )
41+
42+ # alias(
43+ # name = "main_image",
44+ # actual = "_main_image",
45+ # )
46+
3247oci_load (
3348 name = "main_image.load" ,
3449 image = ":main_image" ,
Original file line number Diff line number Diff line change 55 version = "0.0.1" ,
66)
77
8+ bazel_dep (name = "aspect_bazel_lib" , version = "2.19.4" )
89bazel_dep (name = "rules_python" , version = "1.5.1" )
910bazel_dep (name = "rules_oci" , version = "2.2.6" )
1011bazel_dep (name = "platforms" , version = "1.0.0" )
You can’t perform that action at this time.
0 commit comments