Skip to content

Latest commit

 

History

History
130 lines (113 loc) · 3.7 KB

README.md

File metadata and controls

130 lines (113 loc) · 3.7 KB

Bazel Docker run Rules

Rules in this directory provide functionality to run commands inside a docker container. Note these rules require a docker binary to be present and configured properly via docker toolchain rules.

Docker run Rules

container_run_and_commit

container_run_and_commit(name, commands, image)

This rule runs a set of commands in a given image, waits for the commands to finish, and then commits the container to a new image.

Attributes

name Name; required

A unique name for this target.

commands List of strings; required

A list of commands to run (sequentially) in the container.

image Label; required

The image to run the commands in.

container_run_and_extract

container_run_and_extract(name, commands, docker_run_flags, extract_file, image)

This rule runs a set of commands in a given image, waits for the commands to finish, and then extracts a given file from the container to the bazel-out directory.

Attributes

name Name; required

A unique name for this target.

commands List of strings; required

A list of commands to run (sequentially) in the container.

docker_run_flags List of strings; optional

Extra flags to pass to the docker run command.

extract_file String; required

Path to file to extract from container.

image Label; required

The image to run the commands in.