question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Entrypoint example with run-java-sh

See original GitHub issue

Environment: N/A

  • Jib version: latest
  • Build tool: Maven
  • OS: Mac

Description of the issue:

run-java-sh describes itself as a “universal startup script for Java applications, especially crafted for being run from within containers”.

I understand Jib can offer <entrypoint> configs, yet would like to see an example of how this can be configured when there are external dependencies that include such scripts.

Expected behavior:

Example or documentation how to include external dependencies that include entrypoint scripts.

Additional details:

Mostly interested in the dynamic memory calculation functions

No, haven’t tried it 🙂

Not sure if works for your packaging layout, or requires a JAR - ref. bash script

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
chanseokohcommented, Jun 8, 2021

which I know would eventually get pulled into target/

If this is the case and as long as the file exists at target/foo/bar/entrypoint.sh by the time Jib runs (by whatever means, by maven-resources-plugin, whether extracted from a dependency somehow, etc.), you should be able to copy that file into an image (e.g., at /script/entrypoint.sh) using <extraDirectories>. Just make sure the file gets placed before the Jib plugin runs. And note, then, the entrypoint you should set should be <entrypiont>/script/entrypoint.sh (i.e., the path inside the image). Basically, I don’t see anything particularly interesting about this scenario; Jib can copy what it can see into an image, and you set the image entrypoint to whatever suits you.

0reactions
OneCricketeercommented, Jun 5, 2021

we have no plan to natively support this scenario

AFAICT, using an entrypoint script is a regularly asked scenario ( https://github.com/GoogleContainerTools/jib/issues/3147#issuecomment-820629454 for example would be useful for exposing the class name to the script ) , not sure if it matters if it is part of the project, the base image, or external.

My question was asking how that can be done from a dependency, which I know would eventually get pulled into target/, so should I be able to reference <entrypoint>${project.build.directory}/foo/bar/entrypoint.sh</entrypoint>, assuming something has already placed a file there (for example, the maven-resources-plugin)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Container Images - Quarkus
Custom Entrypoint. The quarkus.jib.jvm-entrypoint configuration property can be used to completely override the container entry point and can thus be used ...
Read more >
Run java program and shell script on entrypoint in Dockerfile
In my child docker image where I am referencing this parent docker image, I have a separate entrypoint which starts my container as...
Read more >
3f122bb54c59 - Quay.io
Manifest Layers. ENTRYPOINT ["/deployments/run-java.sh"].
Read more >
How to properly override the ENTRYPOINT using docker run
docker run -it --entrypoint /usr/bin/redis-cli example/redis --help. This means that if we want to pass the -al flags to our ls command we...
Read more >
Run Quarkus inside docker | Dockerizing a Quarkus Application
... 33 && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found