forked from GoogleContainerTools/container-structure-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defs.bzl
29 lines (23 loc) · 1.12 KB
/
defs.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"Exposes container-structure-test as a Bazel rule"
load("//bazel:container_structure_test.bzl", "lib")
container_structure_test = rule(
implementation = lib.implementation,
attrs = lib.attrs,
doc = """\
Tests a Docker- or OCI-format image.
By default, it relies on the container runtime already installed and running on the target.
By default, container-structure-test uses the socket available at `/var/run/docker.sock`.
If the installation creates the socket in a different path, use
`--test_env=DOCKER_HOST='unix://<path_to_sock>'`.
To avoid putting this into the commandline or to instruct bazel to read it from terminal environment,
simply add `test --test_env=DOCKER_HOST` into the `.bazelrc` file.
Alternatively, use the `driver = "tar"` attribute to avoid the need for a container runtime, see
https://github.com/GoogleContainerTools/container-structure-test#running-file-tests-without-docker
""",
test = True,
toolchains = [
"@aspect_bazel_lib//lib:yq_toolchain_type",
"@bazel_tools//tools/sh:toolchain_type",
"@container_structure_test//bazel:structure_test_toolchain_type",
],
)