1
- load ("@aspect_bazel_lib//lib:transitions.bzl" , "platform_transition_filegroup" )
2
1
load ("@rules_oci//oci:defs.bzl" , "oci_image" , "oci_image_index" , "oci_push" )
3
2
load ("@rules_pkg//pkg:tar.bzl" , "pkg_tar" )
4
3
@@ -9,7 +8,7 @@ def multiarch_go_image(name, binary):
9
8
name: resulting oci_image_index target
10
9
binary: label of a go_binary target; it may be transitioned to another architecture
11
10
"""
12
- images = []
11
+
13
12
tar_target = "_{}.tar" .format (name )
14
13
image_target = "_{}.image" .format (name )
15
14
@@ -30,19 +29,13 @@ def multiarch_go_image(name, binary):
30
29
tags = ["manual" ],
31
30
)
32
31
33
- for arch in ["amd64" , "arm64" ]:
34
- arch_image_target = "{}_{}_image" .format (name , arch )
35
- target_platform = "@rules_go//go/toolchain:linux_" + arch
36
- images .append (arch_image_target )
37
- platform_transition_filegroup (
38
- name = arch_image_target ,
39
- srcs = [image_target ],
40
- target_platform = target_platform ,
41
- )
42
-
43
32
oci_image_index (
44
33
name = name ,
45
- images = images ,
34
+ images = [image_target ],
35
+ platforms = [
36
+ "@rules_go//go/toolchain:linux_amd64" ,
37
+ "@rules_go//go/toolchain:linux_arm64" ,
38
+ ],
46
39
)
47
40
48
41
def container_push_official (name , image , component ):
0 commit comments