x-bazel-build: &bazel_build context: . dockerfile: bazel/Dockerfile x-bazel-environment: &bazel_environment - DOCKER_COMMAND - GITHUB_TOKEN # The published envoy-build entrypoint reads USER_UID and re-stamps the # baked-in `envoybuild` user to match, then drops privileges (setpriv). # The user is always named `envoybuild` in the image -- only the uid is # reconciled -- so USER_NAME is not part of this contract. - USER_UID # Point it at the bind-mounted runner home so bazel and the cache land in # the same place the host mounts. # NOTE: the entrypoint sets HOME to the home of `envoybuild` # (/home/envoybuild), as gosu did, so the command does not see this. - HOME=/home/runner x-bazel-command: &bazel_command - "bash" - "-c" - | set -e cd /source/bazel exec ${DOCKER_COMMAND:-bash} x-bazel-volumes: &bazel_volumes - ${SOURCE_DIR:-..}:/source - ${EXTRA_DEV:-/tmp/extra_dev}:/extra_dev services: bazel: stdin_open: true tty: true build: <<: *bazel_build target: ci environment: *bazel_environment command: *bazel_command volumes: *bazel_volumes working_dir: /source/bazel # Variant for workloads that build chrooted cross-arch sysroots. # # The qemu image adds debootstrap and qemu-user-static to the ci image. # # Only chroot(2) is actually required, i.e. CAP_SYS_CHROOT, provided the # sysroot build uses the two-stage `debootstrap --foreign` flow (copy # qemu-$arch-static into the rootfs, then run --second-stage under chroot). # binfmt_misc registration is deliberately not done here -- it mutates host # kernel state and is what previously forced `privileged: true`. bazel-privileged: stdin_open: true tty: true build: <<: *bazel_build target: qemu environment: *bazel_environment command: *bazel_command cap_add: - SYS_CHROOT volumes: *bazel_volumes working_dir: /source/bazel