rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

`container_pull`

Open vinayan3 opened this issue 2 years ago • 1 comments

🚀 feature request

Relevant Rules

container_pull

Description

Add an attribute to allow for the naming of the image that is pulled. container_pull generates out a container_import target which defaults to the name "image". When this is imported into docker it results in an image which has the path bazel:image.

This is not descriptive and when you list images on your machine it's very hard to tell which :image is what.

A clear and concise description of the problem or missing capability...

Describe the solution you'd like

It'd be great if instead we could actually have the repository set to the name from container_pull and the tag reused. It would make it much more clear what the imported image is.

If you have a solution in mind, please describe it.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

vinayan3 avatar Jun 24 '22 22:06 vinayan3

We ran into this too. We worked around this with:

third_party/io_docker_index_library_postgres/BUILD.bazel
load("@io_bazel_rules_docker//container:container.bzl", "container_image")

# A weird hack which gives the image a unique tag.
container_image(
    name = "image",
    base = "@io_docker_index_library_postgres//image",
    visibility = ["//visibility:public"],
)

uhthomas avatar Jun 29 '22 16:06 uhthomas

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!

github-actions[bot] avatar Dec 27 '22 02:12 github-actions[bot]

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

github-actions[bot] avatar Jan 26 '23 02:01 github-actions[bot]