标签:php

docker 镜像的 squash 优化

前言
最近重新优化生产环境的php镜像底包,发现打包结束后大小达到了惊人的2.04G,于是得优化优化了。
常规方案
合并RUN、分阶段构建早用过了,用过之后是2G,当前层级关系如下:
docker-squash 方案
准备进行优化:
优化后的层级和大小,效果很好,而且层级也没了,反正是底包,关系不大
官方docker build –squash...

Declaration of Illuminate\Container\Container::get($id) must be compatible with Psr\Container\ContainerInterface::get(string $id)

痛苦的BUG折腾了一个下午!!!
第一步Google, 得到链接: https://stackoverflow.com/questions/66526288/declaration-of-illuminate-container-containergetid-must-be-compatible-with
以为so easy, 然后看自己的composer.json上面写着: “psr/container”: “1.0.0”
过了很久很久,看了很多文...