Image too large after docker submitted

  docker, question

I am using itdockerstructureLNMPEnvironment, I usedockerGot itcentosThe mirror image of the, and then in thecentosBuild inLNMPThe environment, I installedmysqlThis was followed by another one.commitWhen the mirror size is finished282M, and then I entered againYum install phpAfter completioncommitAfter a while, the mirror size changed to659M, why is this so, why is the growth so big?

When installing programs through yum, many temporary files will be generated and many unnecessary software packages will be installed as recommended software. The image will naturally become larger.

In addition, it is better not to run all programs in one container, but to build services through container layout.