2021-05-24 00:11:57 +03:00
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
2021-05-24 00:11:58 +03:00
|
|
|
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
|
2021-05-24 00:11:58 +03:00
|
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
|
2021-05-24 00:11:57 +03:00
|
|
|
|
|
|
|
go_library(
|
2021-05-24 00:11:57 +03:00
|
|
|
name = "go_default_library",
|
2021-05-24 00:11:57 +03:00
|
|
|
srcs = ["main.go"],
|
2021-05-24 00:11:57 +03:00
|
|
|
importpath = "github.com/motiejus/code/undocker",
|
|
|
|
visibility = ["//visibility:private"],
|
2021-05-24 00:11:57 +03:00
|
|
|
deps = [
|
2021-05-24 00:11:58 +03:00
|
|
|
"//src/undocker/internal/cmdlxcconfig:go_default_library",
|
2021-05-24 00:11:58 +03:00
|
|
|
"//src/undocker/internal/cmdrootfs:go_default_library",
|
2021-05-24 00:11:57 +03:00
|
|
|
"@com_github_jessevdk_go_flags//:go_default_library",
|
2021-05-24 00:11:57 +03:00
|
|
|
],
|
2021-05-24 00:11:57 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
go_binary(
|
|
|
|
name = "undocker",
|
2021-05-24 00:11:57 +03:00
|
|
|
embed = [":go_default_library"],
|
2021-05-24 00:11:57 +03:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
2021-05-24 00:11:58 +03:00
|
|
|
|
2021-05-24 00:11:58 +03:00
|
|
|
genrule(
|
|
|
|
name = "alpine-rootfs",
|
2021-05-24 00:11:58 +03:00
|
|
|
srcs = ["@alpine//image"],
|
2021-05-24 00:11:58 +03:00
|
|
|
outs = ["alpine-rootfs.tar"],
|
|
|
|
cmd = "$(location :undocker) rootfs $< $@",
|
|
|
|
tools = [":undocker"],
|
|
|
|
)
|