Skip to content
Advertisement

Unable to add PPA ondrejPHP in Dockerfile

I want to extend the httpd Image with PHP and some PHP Modules. My Dockerfile for this looks like this.

JavaScript

The error I’m getting when building the Image is followingDocker error

What am I´m doing wrong?

Edit: Thanks to @RJK On step 5/6 your are running add-apt-repository -y ppa:ondrejphp, it should be add-apt-repository -y ppa:ondrej/php (forward slash)

Now the script can find the ppa, but there is another error. enter image description here

Advertisement

Answer

The httpd image is based on Debian and the ondrej repo is designed for Ubuntu, the two are related but it is going to cause you problems.

When add-apt-repository runs it adds the PPA for your current system version, the httpd image is using Debian buster which is equivalent to Ubuntu hirsute (21.04) which isn’t released and there is no packages in the PPA for it. You can work around this by doing the import manually and specifying an ubuntu version (groovy in this case):

JavaScript

However you are just going to run into further problems. I would recommend starting with an Ubuntu base and installing everything you need:

JavaScript
JavaScript

It’s worth noting that there is a warning about setting the correct locale in the PPA description, it should be: LC_ALL=C.UTF-8

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement