Error while pip installing django-rest-framework-social-oauth2 on a docker container


I am trying to implement facebook login in my backend app, while installing "django-rest-framework-social-oauth2" inside the docker container, got this error:

Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-bqvee72k/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i -- 'setuptools>=40.6.0' wheel 'cffi>=1.12; platform_python_implementation != '"'"'PyPy'"'"''
       cwd: None
  Complete output (128 lines):
  Collecting cffi>=1.12
    Downloading cffi-1.14.4.tar.gz (471 kB)
  Collecting wheel
    Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting pycparser
    Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
  Collecting setuptools>=40.6.0
    Downloading setuptools-51.3.3-py3-none-any.whl (786 kB)
  Building wheels for collected packages: cffi
    Building wheel for cffi ( started
    Building wheel for cffi ( finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4ljhxnb3/cffi_043b5b0def434c9f84d19eeae4b121ef/'"'"'; __file__='"'"'/tmp/pip-install-4ljhxnb3/cffi_043b5b0def434c9f84d19eeae4b121ef/'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);'"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-a0ben_ss
         cwd: /tmp/pip-install-4ljhxnb3/cffi_043b5b0def434c9f84d19eeae4b121ef/
    Complete output (50 lines):
    unable to execute 'gcc': No such file or directory
    unable to execute 'gcc': No such file or directory

        No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see
        Otherwise, see or
        the IRC channel #python on

        Trying to continue anyway.  If you are trying to install CFFI from
        a build done in a different context, you can ignore this warning.

I’m using python:3.8-alpine. I can install any other package in the container. Also the package is installed normally on my pc virtual environments.

Source: Docker Questions