wip: rootfs

This commit is contained in:
Motiejus Jakštys 2021-05-24 00:11:58 +03:00
parent 59ab408601
commit c63e2aef29
2 changed files with 32 additions and 0 deletions

1
BUILD
View File

@ -1,4 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//src/undocker:rules.bzl", "rootfs")
go_library( go_library(
name = "go_default_library", name = "go_default_library",

31
rules.bzl Normal file
View File

@ -0,0 +1,31 @@
def _rootfs_impl(ctx):
ctx.actions.run(
executable = ctx.files._undocker,
arguments = [
ctx.attr.src,
ctx.output,
],
)
rootfs = rule(
doc = "Generate a rootfs from a docker container image",
implementation = _rootfs_impl,
attrs = {
"src": attr.label(
doc = "Input container tarball",
mandatory = True,
allow_single_file = [".tar"],
),
"out": attr.output(
doc = "Output rootfs tarball",
mandatory = True,
),
"_undocker": attr.label(
doc = "undocker cli; private and may not be overridden",
cfg = "host",
default = Label("//src/undocker:undocker"),
allow_single_file = True,
executable = True,
),
},
)