Fork me on GitHub
#docker
<
2022-09-29
>
jjttjj20:09:29

If I have an image that has an entrypoint like java -jar my.jar Is there a clean way to run that image in away that prefaces the entrypoint, so that it becomes my-other-command java -jar my.jar Specifically I have an image that is a lambda function that I sometimes want to deploy to the cloud, but locally I want to use https://github.com/aws/aws-lambda-runtime-interface-emulator which requires starting that service with my entry point as the args to that command. I know I can just have a bash if statement and check for an enviromental variable in the dockerfile, but I would prefer to leave the dockerfile just starting the jar, is there a way to "wrap" the normal entrypoint with docker run?

cap10morgan20:09:44

it sounds like you probably want to derive your own docker image

cap10morgan20:09:30

and if you're running a jar, you can probably just put a java image in your FROM line. you may not need any clojure stuff at runtime there.

jjttjj21:09:08

Are you saying I can use my own, jar-starting image as the FROM in another image that instead starts that emulator as the entrypoint? Or that I should just create my own image that does one or the other based on an env var?

cap10morgan21:09:15

I meant the latter, but either one could work

jjttjj21:09:18

gotcha, thanks!

👍 1