nginxinc / NGINX-Demos

NGINX and NGINX Plus demos
Apache License 2.0
1.24k stars 668 forks source link

Nginx regex-tester docker does not build due to missing gpg key #96

Open mathijswesterhof opened 1 year ago

mathijswesterhof commented 1 year ago
...
 => [ 9/13] RUN printf "deb-src https://packages.nginx.org/unit/debian/ `  0.6s
 => ERROR [10/13] RUN apt-get update && apt-get install -y unit php7.0 un  1.7s
------
 > [10/13] RUN apt-get update && apt-get install -y unit php7.0 unit-php:
#0 0.605 Hit:1 http://deb.debian.org/debian bullseye InRelease
#0 0.605 Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
#0 0.605 Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
#0 0.782 Get:4 https://packages.nginx.org/unit/debian bullseye InRelease [2815 B]
#0 1.137 Err:4 https://packages.nginx.org/unit/debian bullseye InRelease
#0 1.137   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
#0 1.143 Reading package lists...
#0 1.701 W: GPG error: https://packages.nginx.org/unit/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
#0 1.701 E: The repository 'https://packages.nginx.org/unit/debian bullseye InRelease' is not signed.
------
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install -y unit php7.0 unit-php]: exit code: 100

When pulling master and running the docker-compose up -d command the build tries to pull a repository that does not have the correct key. this can be fixed by adding the key

RUN wget -q -O - https://unit.nginx.org/keys/nginx-keyring.gpg | gpg --dearmor > /usr/share/keyrings/nginx-keyring.gpg

and modifying the print statements to

RUN printf "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/debian/ `lsb_release -cs` unit" > /etc/apt/sources.list.d/unit.list
RUN printf "deb-src [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/debian/ `lsb_release -cs` unit" >> /etc/apt/sources.list.d/unit.list
mathijswesterhof commented 1 year ago

A pull request has been set for this issue https://github.com/nginxinc/NGINX-Demos/pull/97 . I have however no clue how to assign or request a review. or how to properly put labels on this.