From 747807f1ea0096da047f8771a9a9b7e9c31e617e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 24 May 2021 00:11:58 +0300 Subject: [PATCH] pkg_tar with intermediate --- BUILD | 9 ++++++++- rules.bzl | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/BUILD b/BUILD index d67189f..24e8c0a 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,5 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("//src/undocker:rules.bzl", "rootfs") load( "@io_bazel_rules_docker//container:container.bzl", @@ -23,7 +24,13 @@ go_binary( visibility = ["//visibility:public"], ) +pkg_tar( + name = "alpine-container-plus", + deps = ["@alpine//image:image"], +) + rootfs( name = "alpine-rootfs", - src = "@alpine//image:image", + #src = "@alpine//image:image", + src = ":alpine-container-plus", ) diff --git a/rules.bzl b/rules.bzl index 0d9a105..2406fc3 100644 --- a/rules.bzl +++ b/rules.bzl @@ -12,7 +12,7 @@ def _rootfs_impl(ctx): ) return [DefaultInfo( files = depset([out]), - runfiles = ctx.runfiles(files = ctx.attr.src.files.to_list()) + runfiles = ctx.runfiles(files = ctx.files.src), )] rootfs = rule(