Cannot “pip install cryptography” in Docker Alpine Linux 3.3 with OpenSSL 1.0.2g and Python 2.7

For those who are still experiencing problems installing cryptography==2.1.4 in Alpine 3.7 like this: writing manifest file ‘src/cryptography.egg-info/SOURCES.txt’ running build_ext generating cffi module ‘build/temp.linux-x86_64-2.7/_padding.c’ creating build/temp.linux-x86_64-2.7 generating cffi module ‘build/temp.linux-x86_64-2.7/_constant_time.c’ generating cffi module ‘build/temp.linux-x86_64-2.7/_openssl.c’ building ‘_openssl’ extension creating build/temp.linux-x86_64-2.7/build creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7 gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c … Read more

How to add trusted root CA to Docker alpine

Append your self-signed cert to /etc/ssl/certs/ca-certificates.crt manually. Assuming you have the self-signed certificate in a file in your build directory called my-cert.pem: FROM alpine:latest COPY my-cert.pem /usr/local/share/ca-certificates/my-cert.crt RUN cat /usr/local/share/ca-certificates/my-cert.crt >> /etc/ssl/certs/ca-certificates.crt && \ apk –no-cache add \ curl Note: When you’re using update-ca-certificates, you need to place your cert file into /usr/local/share/ca-certificates/ first. Otherwise … Read more