Jib custom entrypoint



This article focuses on the use of jib’s custom entrypoint.


                            <arg>java ${JAVA_OPTS} -cp /app/resources/:/app/classes/:/app/libs/* com.example.JibDemoApplication</arg>
  • Entrypoint is customized under the container tag, and then environment variables are injected, so that the jvm configuration does not have to be written to the pom file.
  • Originally, the entrypoint generated by default by jib is in quotation mark mode, for example
"Entrypoint": [

This mode does not seem to support environment variables, so it needs to be changed to a mode without quotation marks and started with sh -c java command


docker run -p 8080:8080 -e JAVA_OPTS='-Xms512m -Xmx512m' --rm jib-demo:20180903

In this way, the JVM can be successfully configured using JAVA_OPTS environment variables.


Jib’s custom entrypoint is only supported in version 0.9.10 and above. if you need to customize entrypoint, please upgrade the jib version first.