Created
September 27, 2018 13:55
-
-
Save knil-sama/884b01bf7510d4970227a2b28a657495 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM amazonlinux:latest | |
| ### PRE-REQUISITES ### | |
| # install pre-requisites | |
| RUN yum -y groupinstall development | |
| RUN yum install -y zlib-devel \ | |
| openssl-devel \ | |
| wget | |
| # Installing openssl-devel alone seems to result in SSL errors in pip (see https://medium.com/@moreless/pip-complains-there-is-no-ssl-support-in-python-edbdce548852) | |
| # Need to install OpenSSL also to avoid these errors | |
| RUN wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2l.tar.gz && \ | |
| tar -zxvf OpenSSL_1_0_2l.tar.gz && \ | |
| cd openssl-OpenSSL_1_0_2l/ && \ | |
| ./config shared && \ | |
| make && \ | |
| make install && \ | |
| export LD_LIBRARY_PATH=/usr/local/ssl/lib/ && \ | |
| cd .. && \ | |
| rm OpenSSL_1_0_2l.tar.gz && \ | |
| rm -rf openssl-OpenSSL_1_0_2l/ | |
| # Install Python 3.6 | |
| RUN wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz && \ | |
| tar xJf Python-3.6.0.tar.xz && \ | |
| cd Python-3.6.0 && \ | |
| ./configure && \ | |
| make && \ | |
| make install && \ | |
| cd .. && \ | |
| rm Python-3.6.0.tar.xz && \ | |
| rm -rf Python-3.6.0 | |
| RUN wget https://bootstrap.pypa.io/get-pip.py && \ | |
| python3 get-pip.py --user && \ | |
| python3 -m pip install --upgrade pip | |
| RUN mkdir /app | |
| RUN mkdir /bundle | |
| ### BUILD ### | |
| COPY requirements.txt /bundle | |
| RUN python3 -m pip install -t /app -r /bundle/requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment