'Getting pg_config not found error while using docker-compose build command

I am trying to setup a new django project which has docker compose reuquirement , while setting up the project it is stalling while installing psycopg2 and giving errors , I am using a Macbook Air M1. Is this a docker issue or macbook issue? Attaching error screenshot for more details enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source