Skip to content

Instantly share code, notes, and snippets.

Last active August 1, 2022 11:52
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A script for building a version of the Zbar library suitable for running in an AWS Lambda instance
# Clear out old images
[ -d "lib" ] && rm -r lib
cat <<EOF >
# This is the actual container-side recipe
yum groupinstall -y "Development Tools"
cd /root
git clone
cd zbar
autoreconf -vfi
./configure --prefix=/usr --without-xshm --without-xv --without-jpeg --without-imagemagick --without-gtk --without-python --without-qt --disable-video
mkdir -p /build/lib
cp -a zbar/.libs/* /build/lib
# Run the recipe in an Amazon Linux 2 container
docker run --rm -it -v $(pwd):/build amazonlinux:2 bash /build/
Copy link

Hi! thanks for the code. do you know how to convert this files into a layer? my lamda function keeps saying "errorMessage": "Unable to import module 'lambda_function': No module named 'pyzbar'"

Copy link

nickovs commented Jul 28, 2022

@yopicon2 I've not tried converting this into a layer, primarily because layers hugely slows down the Lambda container start time. Instead I used the fix that is in NaturalHistoryMuseum/pyzbar#41 which the maintainers merged into one of their branches some time ago but have never got around to releasing :-(

Copy link

yopicon2 commented Aug 1, 2022

Thanks very much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment