treewide: replace rules_docker with rules_oci
rules_docker is not maintained anymore and recommends migration to
rules_oci
Change-Id: I089f3cf44888b3c3c0baa2c84a319b04b1a7dec4
Reviewed-on: https://review.monogon.dev/c/monogon/+/2712
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/pkg/localregistry/def.bzl b/metropolis/pkg/localregistry/def.bzl
index 061a63d..c5fc560 100644
--- a/metropolis/pkg/localregistry/def.bzl
+++ b/metropolis/pkg/localregistry/def.bzl
@@ -1,28 +1,19 @@
-load("@io_bazel_rules_docker//container:providers.bzl", "ImageInfo")
+#load("@io_bazel_rules_docker//container:providers.bzl", "ImageInfo")
def _localregistry_manifest_impl(ctx):
manifest_out = ctx.actions.declare_file(ctx.label.name+".prototxt")
-
+
images = []
referenced = [manifest_out]
for i in ctx.attr.images:
- image_info = i[ImageInfo].container_parts
- referenced.append(image_info['config'])
- referenced.append(image_info['config_digest'])
+ image_file = i.files.to_list()[0]
image = struct(
name = i.label.package + "/" + i.label.name,
- config = struct(
- file_path = image_info['config'].short_path,
- digest_path = image_info['config_digest'].short_path,
- ),
- layers = [],
+ path = image_file.short_path,
)
- for layer in zip(image_info['zipped_layer'], image_info['blobsum']):
- referenced.append(layer[0])
- referenced.append(layer[1])
- image.layers.append(struct(file_path = layer[0].short_path, digest_path=layer[1].short_path))
+ referenced.append(image_file)
images.append(image)
-
+
ctx.actions.write(manifest_out, proto.encode_text(struct(images = images)))
return [DefaultInfo(runfiles = ctx.runfiles(files = referenced), files = depset([manifest_out]))]
@@ -36,9 +27,9 @@
"images": attr.label_list(
mandatory = True,
doc = """
- List of images (with ImageInfo provider) to be served from the local registry.
+ List of images to be served from the local registry.
""",
- providers = [ImageInfo],
+ providers = [],
),
},
)