pip install docker-squash
docker history 查看镜像层数
压缩命令
docker-squash -f <层数,依据docker history> -t 新镜像名称 原镜像名称