Apt-get update fails inside container yarn repo not signed

Sounds good. Just to confirm, I need to build a new phpbb3 import container and can’t. Here’s how to fix it.

Here’s this:

But it recommends using curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - but apt-key is deprecated.

If I do this in the container:

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

Then I can to this:

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

Similarly, if I add

          - 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

before the apt-get update in templates/import/phpbb3.template.yml I’m able to build a new container.

4 Likes