使用官网提供的 docker-compose 配置, 在构建 PHP 镜像的时候失败了,以下是错误的原因:
28.65 The following packages have unmet dependencies:
28.76 php7.4-bcmath : Depends: php7.4-common (= 7.4.3-4ubuntu2.29) but 1:7.4.33-18+ubuntu20.04.1+deb.sury.org+1 is to be installed
28.76 php7.4-gd : Depends: php7.4-common (= 7.4.3-4ubuntu2.29) but 1:7.4.33-18+ubuntu20.04.1+deb.sury.org+1 is to be installed
28.76 php7.4-mysql : Depends: php7.4-common (= 7.4.3-4ubuntu2.29) but 1:7.4.33-18+ubuntu20.04.1+deb.sury.org+1 is to be installed
28.79 E: Unable to correct problems, you have held broken packages.
大概了解了下,卡住的原因是在于 php7.4-common 这个包, 这个包的镜像源是来自 Ondřej Surý ,而这个镜像源里没有所需要的 php7.4-bcmath , 只有来自乌班图的包。 那两个不同的源就导致了依赖不一致,就构建失败了。
官方能不能提供个一劳永逸的镜像直接拉取就能用的,或者给个解决方案也行。