I am trying to build a lambda compatible layer locally
to reduce the size of my deployment. However,
if I try to build normally, my deployment is still too large, so I am
trying to use cflags when installing packages,
using this guide: https://avilpage.com/2020/02/reduce-python-package-footprint.html.
One problem I am running into is that I am getting this error:
docker: Error response from daemon: OCI runtime create failed:
container_linux.go:349: starting container process caused "exec:
"CFLAGS=-g0": executable file not found in $PATH": unknown.
when running with this build file...
build_package.sh
repo_name = 'generic_name'
PKG_DIR="python"
CFLAGS_ARG = "-g0 -Wl -I/usr/include:/usr/local/include -L/usr/lib:/usr/local/lib"
rm -rf ${PKG_DIR} && mkdir -p ${PKG_DIR}
docker run --rm -v $(pwd):/foo -w /foo lambci/lambda:build-python3.8
CFLAGS= ${CFLAGS_ARG}
pip install -r requirements.v1.txt --no-deps --no-cache-dir -t ${PKG_DIR}
rm -rf ${PKG_DIR}/*.dist-info
zip -r ${repo_name}.zip ${PKG_DIR}
rm -rf ${PKG_DIR}
Does anyone know how to fix this error?
I'm not sure how to fix this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…