Comments (4)
I couldn't find a definitive answer to this. What I did for now was created a t3a.nano instance which was enough to download and build ImageMagick 7 myself. I configured it with ./configure --disable-shared --enable-static
which doesn't completely work - there is still a dependency on libgomp.so.1
. I made a zip with magick
in bin
and libgomp.so.1
in lib
, and created a layer from that. It worked fine. So I guess my point is if nobody answers this question it's not that bad to build one yourself. Or, I will share my .zip with you and you can create your own layer from it.
from imagemagick-aws-lambda-2.
one difficulty in the approach I outlined above is that even if you build 'static' you still need to do a few other things.
- The build environment has to have libjpeg-devel (at least). Otherwise magick will run but not be able to do anything
- You need to get those libraries e.g. libjpeg.so.62 into your package so they end up in /opt/lib. The AWS runtime will set the library path to find native deps there.
In general, this isn't pretty. I agree that if the public layer works with arm (I still haven't confirmed this up or down) that's easier to use. I really don't know, though, how durable public layers are. I tend to build my own for a few reasons: one is that I want one layer instead of lots, because I think that improves startup time (is that true?) The other is I'm worried that if the public layer's owner decides to delete it does that leave me in a lurch the next time I go to deploy my stack. So depending on public layers is easy but it makes me nervous, probably because I don't know the answers to these questions.
from imagemagick-aws-lambda-2.
OK. I figured it out, to a point. From the repo page HERE you have to click deploy, which creates a CF stack with one thing in it - the layer. From there, you can
aws lambda get-layer-version-by-arn --arn the_layer_arn_from_your_cf_stack --query Content.Location --output text
That gets you a REALLY long URL that you can fetch with curl
to get a .zip file. You can look at that zip, meaning what's actually in the layer. I pasted it at the end here because it's long-ish.
The answer to the question of whether or not it will work on ARM is answered here:
% file bin/magick
bin/magick: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=f5f01bcc9ded1523262578d824e5238940f021f9, with debug_info, not stripped
It is definitely built for x86, and doesn't include both. It also does not have any .so files in it. The executable itself is only linked against libraries that are already in the lambda environment:
% ldd bin/magick
linux-vdso.so.1 (0x00007fffeed91000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5096fb0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5096c10000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f50969f0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f50965f0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5097400000)
The image includes a bunch of files that I am not sure about, as in, why do they need to be there, meaning everything in include/ and lib/ - in particular, I'm not sure why you'd need a bunch of static libraries or include files.
./bin
./bin/animate
./bin/compare
./bin/composite
./bin/conjure
./bin/convert
./bin/display
./bin/identify
./bin/import
./bin/magick
./bin/magick-script
./bin/MagickCore-config
./bin/MagickWand-config
./bin/mogrify
./bin/montage
./bin/stream
./etc
./etc/ImageMagick-7
./etc/ImageMagick-7/colors.xml
./etc/ImageMagick-7/delegates.xml
./etc/ImageMagick-7/log.xml
./etc/ImageMagick-7/mime.xml
./etc/ImageMagick-7/policy.xml
./etc/ImageMagick-7/quantization-table.xml
./etc/ImageMagick-7/thresholds.xml
./etc/ImageMagick-7/type-apple.xml
./etc/ImageMagick-7/type-dejavu.xml
./etc/ImageMagick-7/type-ghostscript.xml
./etc/ImageMagick-7/type-urw-base35.xml
./etc/ImageMagick-7/type-windows.xml
./etc/ImageMagick-7/type.xml
./include
./include/ImageMagick-7
./include/ImageMagick-7/MagickCore
./include/ImageMagick-7/MagickCore/animate.h
./include/ImageMagick-7/MagickCore/annotate.h
./include/ImageMagick-7/MagickCore/artifact.h
./include/ImageMagick-7/MagickCore/attribute.h
./include/ImageMagick-7/MagickCore/blob.h
./include/ImageMagick-7/MagickCore/cache-view.h
./include/ImageMagick-7/MagickCore/cache.h
./include/ImageMagick-7/MagickCore/channel.h
./include/ImageMagick-7/MagickCore/cipher.h
./include/ImageMagick-7/MagickCore/client.h
./include/ImageMagick-7/MagickCore/coder.h
./include/ImageMagick-7/MagickCore/color.h
./include/ImageMagick-7/MagickCore/colormap.h
./include/ImageMagick-7/MagickCore/colorspace.h
./include/ImageMagick-7/MagickCore/compare.h
./include/ImageMagick-7/MagickCore/composite.h
./include/ImageMagick-7/MagickCore/compress.h
./include/ImageMagick-7/MagickCore/configure.h
./include/ImageMagick-7/MagickCore/constitute.h
./include/ImageMagick-7/MagickCore/decorate.h
./include/ImageMagick-7/MagickCore/delegate.h
./include/ImageMagick-7/MagickCore/deprecate.h
./include/ImageMagick-7/MagickCore/display.h
./include/ImageMagick-7/MagickCore/distort.h
./include/ImageMagick-7/MagickCore/distribute-cache.h
./include/ImageMagick-7/MagickCore/draw.h
./include/ImageMagick-7/MagickCore/effect.h
./include/ImageMagick-7/MagickCore/enhance.h
./include/ImageMagick-7/MagickCore/exception.h
./include/ImageMagick-7/MagickCore/feature.h
./include/ImageMagick-7/MagickCore/fourier.h
./include/ImageMagick-7/MagickCore/fx.h
./include/ImageMagick-7/MagickCore/gem.h
./include/ImageMagick-7/MagickCore/geometry.h
./include/ImageMagick-7/MagickCore/histogram.h
./include/ImageMagick-7/MagickCore/identify.h
./include/ImageMagick-7/MagickCore/image-view.h
./include/ImageMagick-7/MagickCore/image.h
./include/ImageMagick-7/MagickCore/layer.h
./include/ImageMagick-7/MagickCore/linked-list.h
./include/ImageMagick-7/MagickCore/list.h
./include/ImageMagick-7/MagickCore/locale_.h
./include/ImageMagick-7/MagickCore/log.h
./include/ImageMagick-7/MagickCore/magic.h
./include/ImageMagick-7/MagickCore/magick-baseconfig.h
./include/ImageMagick-7/MagickCore/magick-config.h
./include/ImageMagick-7/MagickCore/magick-type.h
./include/ImageMagick-7/MagickCore/magick.h
./include/ImageMagick-7/MagickCore/MagickCore.h
./include/ImageMagick-7/MagickCore/matrix.h
./include/ImageMagick-7/MagickCore/memory_.h
./include/ImageMagick-7/MagickCore/method-attribute.h
./include/ImageMagick-7/MagickCore/methods.h
./include/ImageMagick-7/MagickCore/mime.h
./include/ImageMagick-7/MagickCore/module.h
./include/ImageMagick-7/MagickCore/monitor.h
./include/ImageMagick-7/MagickCore/montage.h
./include/ImageMagick-7/MagickCore/morphology.h
./include/ImageMagick-7/MagickCore/nt-base.h
./include/ImageMagick-7/MagickCore/opencl.h
./include/ImageMagick-7/MagickCore/option.h
./include/ImageMagick-7/MagickCore/paint.h
./include/ImageMagick-7/MagickCore/pixel-accessor.h
./include/ImageMagick-7/MagickCore/pixel.h
./include/ImageMagick-7/MagickCore/policy.h
./include/ImageMagick-7/MagickCore/prepress.h
./include/ImageMagick-7/MagickCore/profile.h
./include/ImageMagick-7/MagickCore/property.h
./include/ImageMagick-7/MagickCore/quantize.h
./include/ImageMagick-7/MagickCore/quantum.h
./include/ImageMagick-7/MagickCore/random_.h
./include/ImageMagick-7/MagickCore/registry.h
./include/ImageMagick-7/MagickCore/resample.h
./include/ImageMagick-7/MagickCore/resize.h
./include/ImageMagick-7/MagickCore/resource_.h
./include/ImageMagick-7/MagickCore/segment.h
./include/ImageMagick-7/MagickCore/semaphore.h
./include/ImageMagick-7/MagickCore/shear.h
./include/ImageMagick-7/MagickCore/signature.h
./include/ImageMagick-7/MagickCore/splay-tree.h
./include/ImageMagick-7/MagickCore/static.h
./include/ImageMagick-7/MagickCore/statistic.h
./include/ImageMagick-7/MagickCore/stream.h
./include/ImageMagick-7/MagickCore/string_.h
./include/ImageMagick-7/MagickCore/studio.h
./include/ImageMagick-7/MagickCore/threshold.h
./include/ImageMagick-7/MagickCore/timer.h
./include/ImageMagick-7/MagickCore/token.h
./include/ImageMagick-7/MagickCore/transform.h
./include/ImageMagick-7/MagickCore/type.h
./include/ImageMagick-7/MagickCore/utility.h
./include/ImageMagick-7/MagickCore/version.h
./include/ImageMagick-7/MagickCore/vision.h
./include/ImageMagick-7/MagickCore/widget.h
./include/ImageMagick-7/MagickCore/xml-tree.h
./include/ImageMagick-7/MagickCore/xwindow.h
./include/ImageMagick-7/MagickWand
./include/ImageMagick-7/MagickWand/animate.h
./include/ImageMagick-7/MagickWand/compare.h
./include/ImageMagick-7/MagickWand/composite.h
./include/ImageMagick-7/MagickWand/conjure.h
./include/ImageMagick-7/MagickWand/convert.h
./include/ImageMagick-7/MagickWand/deprecate.h
./include/ImageMagick-7/MagickWand/display.h
./include/ImageMagick-7/MagickWand/drawing-wand.h
./include/ImageMagick-7/MagickWand/identify.h
./include/ImageMagick-7/MagickWand/import.h
./include/ImageMagick-7/MagickWand/magick-cli.h
./include/ImageMagick-7/MagickWand/magick-image.h
./include/ImageMagick-7/MagickWand/magick-property.h
./include/ImageMagick-7/MagickWand/MagickWand.h
./include/ImageMagick-7/MagickWand/method-attribute.h
./include/ImageMagick-7/MagickWand/mogrify.h
./include/ImageMagick-7/MagickWand/montage.h
./include/ImageMagick-7/MagickWand/operation.h
./include/ImageMagick-7/MagickWand/pixel-iterator.h
./include/ImageMagick-7/MagickWand/pixel-wand.h
./include/ImageMagick-7/MagickWand/stream.h
./include/ImageMagick-7/MagickWand/wand-view.h
./include/ImageMagick-7/MagickWand/wandcli.h
./lib
./lib/ImageMagick-7.0.8
./lib/ImageMagick-7.0.8/config-Q16HDRI
./lib/ImageMagick-7.0.8/config-Q16HDRI/configure.xml
./lib/libMagickCore-7.Q16HDRI.a
./lib/libMagickCore-7.Q16HDRI.la
./lib/libMagickWand-7.Q16HDRI.a
./lib/libMagickWand-7.Q16HDRI.la
./lib/pkgconfig
./lib/pkgconfig/ImageMagick-7.Q16HDRI.pc
./lib/pkgconfig/ImageMagick.pc
./lib/pkgconfig/MagickCore-7.Q16HDRI.pc
./lib/pkgconfig/MagickCore.pc
./lib/pkgconfig/MagickWand-7.Q16HDRI.pc
./lib/pkgconfig/MagickWand.pc
./share
./share/ImageMagick-7
./share/ImageMagick-7/english.xml
./share/ImageMagick-7/francais.xml
./share/ImageMagick-7/locale.xml
from imagemagick-aws-lambda-2.
I have recently compiled one for arm architecture, you can find it here
https://github.com/CyprusCodes/imagemagick-aws-lambda-2/tree/master/archive
from imagemagick-aws-lambda-2.
Related Issues (20)
- lambda with imagemagick not working 10.x HOT 3
- Python 3.8 is running based on Amazon Linux 2 HOT 1
- update example to include AWS-CDK usage HOT 1
- Looking for guidance
- Can current AWS Lambda Layer support nodejs 12? HOT 1
- question on usage in layer HOT 7
- Adding libheif support breaks build HOT 7
- Help for adding jxrlib to the layer
- Support for AVIF
- SNS Event Notification Not Passing bucket name in example
- [SUGGESTION] Removing lib before make deploy could reduce size of the layer drastically
- LCMS delegate missing HOT 1
- AWS Lambda Layer in AWS Serverless App Repository does not list nodejs 12 as a compatible layer HOT 2
- Convert Issue (Possibly fixed by latest Image Magick build)
- drawText doesn't appear to work with this layer HOT 2
- AccessDenied
- Is MONTAGE also included in this?
- Using ImageMagick has some vulnerability HOT 1
- Ask for update to lastest ImageMagick and Nodejs HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagemagick-aws-lambda-2.