Docker Community Forums

Share and learn in the Docker community.

How to add new script while configuring cmd and entrypoint

docker

#1

My company asked me to configure a docker image. It has cmd parameter as:

"Cmd": [
            "/bin/sh",
            "-c",
            "#(nop) ",
            "ENTRYPOINT [\"java\" \"-jar\" \"/opt/app.jar\" \"--server.port=8090\"]"
        ]

and entrypoint as :

"Entrypoint": [
            "java",
            "-jar",
            "/opt/app.jar",
            "--server.port=8090"
        ]

I want to run an addition shell script during start up. How should I configure this? Did tons of research but I am really confused about why there is an “Entrypoint” inside “Cmd”.


(Martin Terp) #2

Hi

You could wrap the entrypoint in a script, that runs the commands you need, and then the java part last.