Skip to content

multiarch to build a linux/x86_64 go_test() on a Darwin/arm64 host ? #32

@chickenandpork

Description

@chickenandpork

hey.

Would you be accepting of a PR that allows the user to run go_docker_compose_test() on an platform_host not matching the container arch?

ie:

go_docker_compose_test(
    name = "go-test-image-test",
    docker_compose_file = ":docker-compose.yml",
    docker_compose_test_container = "test_container",
+ platforms =  platforms = [ ":linux_arm64", ":linux_amd64" ],  # Mac and linux both run GOOS==linux
    test_srcs = glob(["**/*_test.go"]),
    test_deps = [],
    test_image_base = "@ubuntu",
)

...to allow building a multi-arch OCI (index + 2 images), even on a Mac? User-story here would be a Mac user testing linux OCI images locally and wanting to compile that unittest with the proper linux GOOS so that the test-runner runs in the container arch/os.

Alternatively, plumbing through GOOS might suffice, but GOARCH may still depend on the host.

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