rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

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

Open lbcjbb opened this issue 3 years ago • 0 comments

🐞 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)

lbcjbb avatar May 08 '22 20:05 lbcjbb