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

entrypoint / launcher in nodejs_image isn't respected #1802

Closed
martaver opened this issue Apr 7, 2021 · 2 comments
Closed

entrypoint / launcher in nodejs_image isn't respected #1802

martaver opened this issue Apr 7, 2021 · 2 comments
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@martaver
Copy link
Contributor

martaver commented Apr 7, 2021

🐞 bug report

Affected Rule

The problem is with nodejs_image.

Is this a regression?

I'm not sure, I've only recently started with bazel.

Description

I am trying to run a script prior to executing the nodejs binary, in order to initialise some system dependencies that I installed on a custom base image.

The 'dockerfile' way to do this is to use an ENTRYPOINT script described here:
https://stackoverflow.com/questions/41512237/how-to-execute-a-shell-command-before-the-entrypoint-via-the-dockerfile

...and then call node with CMD

However, nodejs_image seems to use CMD for args, and ENTRYPOINT for the nodejs binary.

Also when I provide it with an alternative entrypoint or a launcher, the resulting docker image ignores both, and the ENTRYPOINT remains stuck at: "/app/path/to/myapp"

The net result of this is that I can't configure 'launcher scripts' and use nodejs_image at the same time.

🔬 Minimal Reproduction

Clone:
https://github.com/cleric-sh/cleric-bazel

Run:

bazelisk run //services/messenger:image

Then:

docker image inspect bazel/services/messenger:image

Not that the launcher defined in images/chrome/BUILD:34 is left out.

🌍 Your Environment

Operating System:

  
OSX 11.2.3
  

Output of bazel version:

  
Bazelisk version: v1.7.5
Build label: 4.0.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 21 07:38:50 2021 (1611214730)
Build timestamp: 1611214730
Build timestamp as int: 1611214730
  

Rules_docker version:

  
v0.16.0
  

Anything else relevant?

@martaver martaver mentioned this issue May 18, 2021
12 tasks
@github-actions
Copy link

github-actions bot commented Oct 4, 2021

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 Oct 4, 2021
@martaver
Copy link
Contributor Author

This has been implemented in https://github.com/bazelbuild/rules_docker/tree/v0.18.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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

1 participant