Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to 'disable' an entrypoint in a base image (override to []) #336

Closed
sfc-gh-ptabor opened this issue Aug 17, 2023 · 1 comment · Fixed by #662
Closed

Ability to 'disable' an entrypoint in a base image (override to []) #336

sfc-gh-ptabor opened this issue Aug 17, 2023 · 1 comment · Fixed by #662
Labels
enhancement New feature or request

Comments

@sfc-gh-ptabor
Copy link
Contributor

I have a base image that has 'entrypoint' set.

I would like to use 'oci_image' to override the entrypoint to [].

but If I try, to do:

  oci_image(
    ...
    entrypoint=[],
    ...
  )

The image stays as is... as the empty entrypoint is ignored:

if ctx.attr.entrypoint:
args.add_joined("--entrypoint", ctx.attr.entrypoint, join_with = ",")

I think that nice solution depends on: bazelbuild/bazel#14434

But I think it could be worked around by declaring:

"entrypoint": attr.string_list(doc = "A list of arguments to use as the `command` to execute when the container starts. These values act as defaults and may be replaced by an entrypoint specified when creating a container.",
  default=["#magic-ignored-entrypoint#"]),
@sfc-gh-ptabor sfc-gh-ptabor changed the title How to 'disable' an entrypoint Ability to 'disable' an entrypoint in a base image (override to []) Aug 17, 2023
@thesayyn thesayyn added the enhancement New feature or request label Dec 12, 2023
@thesayyn
Copy link
Collaborator

thesayyn commented May 7, 2024

There's a workaround for this, if you provide an empty file to entrypoint, oci_image will set entrypoint to []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants