Apt-get 更新在容器内失败 yarn 仓库未签名

好的。只是为了确认一下,我需要构建一个新的 phpbb3 导入容器,但无法构建。 这是修复方法。

这是:

但它建议使用 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -,但 apt-key 已弃用。

如果我在容器中执行此操作:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg -o /usr/share/keyrings/yarn-keyring.asc \
    && sed -i '1s;^deb;deb [signed-by=/usr/share/keyrings/yarn-keyring.asc];' /etc/apt/sources.list.d/yarn.list

然后我就可以执行此操作:

root@monstera-web-only:/# apt-get update
Hit:1 https://deb.nodesource.com/node_18.x bullseye InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Get:3 https://dl.yarnpkg.com/debian stable InRelease [17.1 kB]
Get:4 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Hit:5 http://deb.debian.org/debian bullseye-updates InRelease
Hit:6 http://deb.debian.org/debian bullseye-backports InRelease
Get:7 https://dl.yarnpkg.com/debian stable/main all Packages [10.9 kB]
Get:8 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [216 kB]
Hit:9 http://apt.postgresql.org/pub/repos/apt bullseye-pgdg InRelease
Get:10 https://dl.yarnpkg.com/debian stable/main amd64 Packages [10.9 kB]
Fetched 286 kB in 0s (849 kB/s)
Reading package lists... Done

同样,如果我在 templates/import/phpbb3.template.ymlapt-get update 之前添加

          - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg -o /usr/share/keyrings/yarn-keyring.asc && sed -i '1s;^deb;deb [signed-by=/usr/share/keyrings/yarn-keyring.asc];' /etc/apt/sources.list.d/yarn.list

我就能构建一个新的容器。

3 个赞