As I was trying to create an alpine image with python 3.6.7 version and also wanted to install other Python packages from
pip. Docker build kept running into
ssl could not build with
gcc. It took me awhile to find out why it’s happening. In the beginning I thought it was an issue with
pip version of python 3 because some of the issue discussion in GitHub lead me to believe it was an issue with
pip. But upgrading
wheel didn’t help.
After a while, I have found that
libressl-dev to completely build the
cryptography package for python’s several extension packages. So I installed these libraries before attempting to install those third-party python packages.
Apline: 3.8 image –
apk --update add bash python3 openssl ca-certificates python3-dev build-base libressl-dev libffi-dev