What Can I Do If an Error Is Reported When a Deployed Container Is Started After the JVM Startup Heap Memory Parameter Is Specified for ENTRYPOINT in Dockerfile?

Symptom

After the JVM startup heap memory parameter is specified for ENTRYPOINT in the Dockerfile, an error message "invalid initial heap size" is displayed during the deployed container's startup, as shown in the following figure:

Answer

Check the ENTRYPOINT settings. The following settings are incorrect:

ENTRYPOINT ["java","-Xms2g -Xmx2g","-jar","xxx.jar"]

You can use either of the following methods to solve the problem: