Skip to content

Inquiry - How to build ts_project with rules_docker? #3421

@twheys

Description

@twheys

Hello, I am trying to build my Bazel typescript project into a docker container using the container_image rule from rules_docker. Is there any recommended solution for setting the rootDirs?

"compilerOptions": {
    "rootDirs": [
        ".",
        "../../bazel-out/host/bin/path/to",
        "../../bazel-out/darwin-fastbuild/bin/path/to",
        "../../bazel-out/darwin_arm64-fastbuild/bin/path/to",
        "../../bazel-out/k8-fastbuild/bin/path/to",
        "../../bazel-out/x64_windows-fastbuild/bin/path/to",
        "../../bazel-out/darwin-dbg/bin/path/to",
        "../../bazel-out/k8-dbg/bin/path/to",
        "../../bazel-out/x64_windows-dbg/bin/path/to",
    ]
}

The issue with rules_docker is that it uses a Bazel transition which builds all of the ts_project targets in a different Bazel output dir which is suffixed with some hash that appears to change based on some factors unbeknownst to me (ie darwin_arm64-fastbuild-ST-4a519fd6d3e4), which makes it impossible to use the rootDirs workaround.

Is there any known solution to overcome this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions