skip to Main Content

I want to use php8.2 under docker and in Dockerfile.yml I replaced line

FROM php:8.1.6-apache

with

FROM php:8.2-apache

But I got error during complilation :

$ docker-compose up -d --build
Creating network "__docker_default" with the default driver
Building web
Step 1/9 : FROM php:8.2-apache
8.2-apache: Pulling from library/php
a803e7c4b030: Pull complete
84313b8f4350: Pull complete
94f42c54df3f: Pull complete
fac86b32c028: Pull complete
e326747c51cb: Pull complete
2241eb3f28be: Pull complete
82dc7266c2a7: Pull complete
282af1cdfe15: Pull complete
08e95c38e747: Pull complete
941f762c484e: Pull complete
6d95ce521328: Pull complete
367da9bc7f8d: Pull complete
5acf0f9857c5: Pull complete
Digest: sha256:91bd71295902bfc50bb411a8be446ae07724d2839d739c303dbdcdab4235d7f3
Status: Downloaded newer image for php:8.2-apache
 ---> aa1a7b18157c
Step 2/9 : RUN apt-get update &&     apt-get install --assume-yes --no-install-recommends --quiet     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     libmagickwand-dev     curl     build-essential     libnotify-bin     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     locate
 ---> Running in b91f32f38a6c
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 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
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
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
Reading package lists...
W: GPG error: 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
E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.
W: GPG error: 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
E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.
W: GPG error: 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
E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install --assume-yes --no-install-recommends --quiet     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     libmagickwand-dev     curl     build-essential     libnotify-bin     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     locate' returned a non-zero code: 100

and entering the docker bash I still see php8.1 :

$ docker-compose up -d
Creating MySqlPostsTagsCRUDTest_db  ... done
Creating PostsTagsCRUDTest_web          ... done
Creating PostsTagsCRUDTest_composer ... done
Creating MysqlPostsTagsCRUDTest_adminer ... done
$ docker exec -ti PostsTagsCRUDTest_web bash
root@f5fb7dfbf7cc:/var/www/PostsTagsCRUDTest_DOCKER_ROOT# php -v
PHP 8.1.6 (cli) (built: May 28 2022 08:14:41) (NTS)
Copyright (c) The PHP Group

How that can be fixed ?

2

Answers


  1. This isn’t related to php but debian bookworm and being discussed here. Debian turned to "armoured ASCII" and following seems to be a workaround:

    #> mv -i /etc/apt/trusted.gpg.d/debian-archive-*.asc  /root/     ### move /etc/apt/trusted.gpg.d/debian-archive-*.asc to /root/ or to any persistent place you will remember.
    #> ln -s /usr/share/keyrings/debian-archive-* /etc/apt/trusted.gpg.d/
    #> apt update
    

    You can add the above before apt-get update && ... step. Specifically:

    Step 2/9 : RUN apt-get update && apt-get install --assume-yes --no-install-recommends --quiet     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     libzip-dev     nano     mc     git-core     libmagickwand-dev     curl     build-essential     libnotify-bin     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     locate
    
    Login or Signup to reply.
  2. In my case, updating the Docker version fixed the issue.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search