Skip to content

ruby_binary - how to package up runfiles dir #101

@robertgates55

Description

@robertgates55

I'm trying to use the rules to package our rails app into a container. I'm using pkg_tar to collect the output from ruby_binary, allowing the folder structure to be maintained:

ruby_binary(
    name = "server",
    srcs = glob(
        include = [
            "app/**/*",
            "config/**/*",
            "bin/*",
            "config.ru",
        ],
    ),
    main = ":bin/rails",
    deps = [
        "@bundle//:rails",
    ],
)

pkg_tar(
    name = "server_tar",
    strip_prefix = ".",
    package_dir = "/rails",
    srcs = [
        ":server",
    ],
    mode = "0755",
)

However, the tar only contains a single file - the binary runner. The runfiles are not exported and thus not tarred up.

What's the right way to collect these files?

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