-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
require 'rmagick' include Magick module LambdaFunction class Handler def self.process(event:, context:) image_url = event['image_url'] my_image = ImageList.new(image_url) # TODO: Use rmagick to make your image transformations # Docs: https://rmagick.github.io { "success": true } end end end
I wanted to make this guide because while doing all of this process it's been really hard to find information. All the guides I found rely on this layer repository that it's not even updated anymore. I believe having the option to install whatever version of ImageMagick and libraries you want is better. So I hope this helps someone in the future.
FROM public.ecr.aws/lambda/ruby:2.7 # OR: FROM amazon/aws-lambda-ruby:2.7 RUN yum groupinstall -y 'Development Tools' RUN yum install -y libmagickwand-devel libtool-ltdl-devel libpng-devel pkgconfig glibc ghostscript ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig RUN curl https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.4.tar.gz --output libwebp-1.2.4.tar.gz \ && tar xvzf libwebp-1.2.4.tar.gz\ && cd libwebp-1.2.4 \ && ./configure \ && make \ && make install \ && /sbin/ldconfig /usr/local/lib RUN git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.1.0 RUN cd ImageMagick-7.1.0\ && ./configure CPPFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib' \ --prefix=/usr \ --without-perl \ --with-modules \ --without-magick-plus-plus \ --disable-static \ --disable-docs \ --with-png=yes \ --with-webp=yes \ --with-gslib=yes \ && make\ && make install\ && /sbin/ldconfig /usr/local/lib # Copy function code COPY app.rb ${LAMBDA_TASK_ROOT} # Copy dependency management file COPY Gemfile ${LAMBDA_TASK_ROOT} # Install dependencies under LAMBDA_TASK_ROOT ENV GEM_HOME=${LAMBDA_TASK_ROOT} RUN bundle install # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) CMD [ "app.LambdaFunction::Handler.process" ]
Repository: https://github.com/alexmorral/public-guides/blob/main/aws/lambda-imagemagick-docker.md
source 'https://rubygems.org' gem 'rmagick'