Provides a container_test rule that can test containers built with rules_docker.
After the rules_docker setup add the following to your WORKSPACE file:
http_archive(
name = "bazel_rules_container_test",
sha256 = "0ea03839bf059c0ec7c4f95cb6cb048b84094b180b051c737cbef9ca150bcc0b",
strip_prefix = "bazel_rules_container_test-0.11.0",
url = "https://github.com/guymers/bazel_rules_container/archive/0.11.0.tar.gz",
)load("@bazel_rules_container_test//container:test.bzl", "container_test")
container_test(
name = "nodejs",
read_only = False,
size = "small",
files = [
"project/index.js",
"project/package.json",
],
golden = "output.txt",
image = "//nodejs",
test = "test.sh",
)container_test(name, daemon, env, error, files, golden, image, incremental_load_template, mem_limit, options, read_only, regex, test, tmpfs_directories, volume_files, volume_mounts)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| daemon | - | Boolean | optional | False |
| env | - | Dictionary: String -> String | optional | {} |
| error | - | Integer | optional | 0 |
| files | - | List of labels | optional | [] |
| golden | - | Label | optional | None |
| image | - | Label | optional | None |
| incremental_load_template | - | Label | optional | @io_bazel_rules_docker//container:incremental_load_template |
| mem_limit | - | String | optional | "" |
| options | - | List of strings | optional | [] |
| read_only | - | Boolean | optional | True |
| regex | - | Boolean | optional | False |
| test | - | Label | optional | None |
| tmpfs_directories | - | List of strings | optional | [] |
| volume_files | - | List of labels | optional | [] |
| volume_mounts | - | List of strings | optional | [] |