How to install php7.4-gd in App Platform container?

Is there a way to install php7.4-gd in the default container build step?

I´ve tried:

sudo apt-get install -y php7.4-gd

Unfortunately I´m getting an error:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

Without sudo:

E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

You can install the GD extension by adding ext-gd to composer.json like so:

    "require": {
        "ext-gd": "*"

The PHP build environment uses the Heroku PHP Buildpack, so you can refer to the official documentation for more information.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.