bazelbuild / rules_docker

Rules for building and handling Docker images with Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`bazel run` for `container_image` not working as documented

najisawas opened this issue Β· comments

🐞 bug report

Affected Rule

container_image

Is this a regression?

Yes, it seems like according to the documentation, this was supposed to be working

Description

I posted a question with a few layers on Stack Overflow, but specifically from a rules_docker perspective,
the bazel run commands documented here don't work as expected

If i do bazel run server:my_image_arm64 -- -p 8080:8080, rather than the Docker image actually running, it simply creates the container, which I then have to run manually via docker run -p 8080:8080 IMAGE_ID

πŸ”¬ Minimal Reproduction

go_binary(
    name = "main_arm64",
    embed = [":server_lib"],
    goarch = "arm64",
    goos = "linux",
    visibility = ["//visibility:public"],
)

go_image(
    name = "main_server_arm64",
    binary = ":main_arm64",
)

container_image(
    name = "my_image_arm64",
    base = ":main_server_arm64",
    ports = [
        "8080",
        "3306",
    ],
    visibility = ["//visibility:public"],
)

🌍 Your Environment

Operating System:

Mac Os Ventura, M1 Chip

Output of bazel version:

Build label: 6.0.0-homebrew
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800

Rules_docker version:

v0.25.0

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"