Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Can't give a 'user' argument to the container_image implementation #2081

Closed
ghost opened this issue May 8, 2022 · 0 comments
Closed

Can't give a 'user' argument to the container_image implementation #2081

ghost opened this issue May 8, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented May 8, 2022

🐞 bug report

Affected Rule

The only rule affected is the implementation function of the rule container_image, the function _impl / image.implementation in the file container/image.bzl.

Is this a regression?

No.

Description

The user argument can be given to the rule container_image but we can't give it to the implementation function.

🔬 Minimal Reproduction

load("@io_bazel_rules_docker//container:container.bzl", _container = "container")

def _my_container_image_impl(ctx):
    return _container.image.implementation(ctx, user = "myuser")

my_container_image = rule(
    implementation = _my_container_image_impl,
    attrs = _container.image.attrs,
    outputs = _container.image.outputs,
    cfg = _container.image.cfg,
    toolchains = [
        "@io_bazel_rules_docker//toolchains/docker:toolchain_type",
    ],
)

🔥 Exception or Error

...
Error: _impl() got unexpected keyword argument: user

🌍 Your Environment

Operating System:

linux/amd64

Output of bazel version:

4.2.2 / 5.0.0 / 5.1.1

rules_docker version:

v0.23.0 / v0.24.0 / master (0768e1b7f6aa973f9879ac5b8f622dd2f3d88f1d)
@ghost ghost changed the title Given 'user' argument to the container_image implementation is not possible Give the 'user' argument to the container_image implementation is not possible May 8, 2022
@ghost ghost changed the title Give the 'user' argument to the container_image implementation is not possible Can't give a 'user' argument to the container_image implementation May 8, 2022
@ghost ghost closed this as completed Aug 21, 2022
St0rmingBr4in pushed a commit to St0rmingBr4in/rules_docker that referenced this issue Oct 17, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants