Last active
April 29, 2020 04:34
-
-
Save wolfg1969/decd1fc8ba5bb4eaf19adfb57c409c0f to your computer and use it in GitHub Desktop.
Build aws lambda layer for mysqlclient
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
#!/bin/bash | |
rm -rf lib python | |
mkdir -p lib | |
for version in "python3.6" "python3.7" "python3.8" | |
do | |
echo "Building $version ..." | |
mkdir -p python/lib/${version} | |
docker run -v "$PWD":/var/task "lambci/lambda:build-$version" /bin/sh -c "yum install -y mysql-devel && cp /usr/lib64/mysql/libmysqlclient* lib/ && pip install mysqlclient -t python/lib/$version/site-packages/ && exit" | |
done | |
zip -r mysqlclient-lambda-layer.zip lib python > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment