Skip to main content
This page provides details on the contents of the Bazel container, how to build the abseil-cpp project using Bazel inside the Bazel container, and how to build this project directly from the host machine using the Bazel container with directory mounting.

Build Abseil project from your host machine with directory mounting

The instructions in this section allow you to build using the Bazel container with the sources checked out in your host environment. A container is started up for each build command you execute. Build results are cached in your host environment so they can be reused across builds. Clone the project to a directory in your host machine.
Create a folder that will have cached results to be shared across builds.
Use the Bazel container to build the project and make the build outputs available in the output folder in your host machine.
Build the project with sanitizers by adding the --config=<var>asan</var>|<var>tsan</var>|<var>msan</var> build flag to select AddressSanitizer (asan), ThreadSanitizer (tsan) or MemorySanitizer (msan) accordingly.

Build Abseil project from inside the container

The instructions in this section allow you to build using the Bazel container with the sources inside the container. By starting a container at the beginning of your development workflow and doing changes in the worskpace within the container, build results will be cached. Start a shell in the Bazel container:
Each container id is unique. In the instructions below, the container was 5a99103747c6. Clone the project.
Do a regular build.
Build the project with sanitizers by adding the --config=<var>asan</var>|<var>tsan</var>|<var>msan</var> build flag to select AddressSanitizer (asan), ThreadSanitizer (tsan) or MemorySanitizer (msan) accordingly.

Explore the Bazel container

If you haven’t already, start an interactive shell inside the Bazel container.
Explore the container contents.

Explore the Bazel Dockerfile

If you want to check how the Bazel Docker image is built, you can find its Dockerfile at bazelbuild/continuous-integration/bazel/oci.