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

Need to specify a different entrypoint #1649

Closed
nikunjy opened this issue Oct 16, 2020 · 8 comments
Closed

Need to specify a different entrypoint #1649

nikunjy opened this issue Oct 16, 2020 · 8 comments
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@nikunjy
Copy link

nikunjy commented Oct 16, 2020

I have a which is kind of like https://github.com/hashicorp/envconsul
I want this to be the entrypoint of the language image. So let's say I make a go_image I want that the entry point is the envconsul binary and the command is the go_image.binary (basically the actual binary that my code produces).

The only way I have found is to copy over this part and add an argument for entrypoint
https://github.com/bazelbuild/rules_docker/blob/master/go/image.bzl#L123

What is the best way to achieve this?

@nikunjy
Copy link
Author

nikunjy commented Nov 17, 2020

I can do a PR to support this but not sure if someone will accept it. Any guidance @mattmoor ?

@sudoforge
Copy link

if i'm understanding your goal, you want to define a rule that is the equivalent of this docker command line:

docker run --entrypoint=/bin/foo someimage somecommand

there isn't a way to accomplish this with the go_image rule that i'm aware of, but you could accomplish this by creating your own layers with the two binaries and specify your entrypoint/command then.

@nikunjy
Copy link
Author

nikunjy commented Jan 20, 2021

There would be a way to accomplish this with go_image if it just took entrypoint as one of the argument. I can send a PR I just don't know if someone will actually engage me with that, looking at response on this issue. @sudoforge

@nikunjy
Copy link
Author

nikunjy commented Jan 20, 2021

@smukherj1 can you guide here ? Would such a PR be acceptable ?

@github-actions
Copy link

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 github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Jul 20, 2021
@github-actions
Copy link

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

@kriswuollett
Copy link

Can this be reopened? Is passing through entrypoint an acceptable solution? I'd expect to use this by creating a custom go_image with a layer that adds dlv for debugging, and then change the entrypoint to dlv launching the original binary. I assume simple string manipulation of the binary argument can yield the final symlinked path to form the new entrypoint in a macro?

@kriswuollett
Copy link

Although an easy workaround would be to change it in a deployment spec, I'd rather the wrapper script be controlled through environment variables so any deployment args apply just to the underlying binary.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not
Projects
None yet
Development

No branches or pull requests

3 participants