def local_bazel_options(worker_image, crosstool_top, privileged=False):
  """Returns bazel options for the "docker" execution strategy."""
  options = [
      "--spawn_strategy=docker",
      "--genrule_strategy=docker",
      "--cpu=k8",
      "--host_cpu=k8",
      "--crosstool_top=" + crosstool_top,
      "--define=EXECUTOR=remote",
      "--experimental_docker_use_customized_images=false",
      "--experimental_docker_image=" + worker_image,
  ]
  if privileged:
    options.append("--experimental_docker_privileged")
  return options