1

I have problem after upgrading PHP image from 8.0 to PHP image 8.1 and on stackoverflow they sent me there

this is my dockerfile:

FROM php:8.1-apache AS apache RUN a2enmod rewrite WORKDIR /bin WORKDIR ../ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 F8D2585B8783D481 BDE6D2B9216EC7A8 RUN apt update \ && apt install \ curl \ git \ unzip \ cron \ libzip-dev \ libcurl4-openssl-dev \ pkg-config \ libssl-dev \ libpng-dev \ libjpeg62-turbo-dev \ libicu-dev \ wget \ libcap2-bin \ procps \ -y \ && setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2 \ && chown www-data:www-data /var/log/apache2 \ && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \ && apt install -y ./wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \ && rm wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \ && apt-get clean autoclean \ && apt-get autoremove --yes etc... 

During image building I have error;

[0mGet:1 http://deb.debian.org/debian bookworm InRelease [151 kB] Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB] Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] Err:1 http://deb.debian.org/debian bookworm InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481 Err:2 http://deb.debian.org/debian bookworm-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 Err:3 http://deb.debian.org/debian-security bookworm-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8 

If I am adding line:

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9 6ED0E7B82643E131 F8D2585B8783D481 BDE6D2B9216EC7A8 

There is error:

[91mE: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation 

If I am adding apt installer of gnupg in dockerfile... there is the same error with public keys so I cannot install it

What should I do?

1 Answer 1

0

I'm not getting the missing key errors when I try your Dockerfile. I removed the RUN apt-key ... line and the rest just works. Maybe the php:8.1-apache was buggy at the time you wrote this question.

Since it is difficult to test a solution to a problem that can't be replicated, I only have a suggestion: You could take the key files from a working system and just copy them into the image (they should be in /etc/apt/trusted.gpg.d/). That should return apt to a working state.

Other options that should work:

  1. If you already have a valid local cache of the available packages you could just (re-)install the debian-archive-keyring package, which contains the files. But on a fresh Docker image this is not likely.

  2. You can just download the debian-archive-keyring .deb file from a mirror and install it manually.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.