Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.
/ go-vips-lambda Public archive
forked from customink/ruby-vips-lambda

Libvips AWS Lambda Layer for Golang

Notifications You must be signed in to change notification settings

krlv/go-vips-lambda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Libvips AWS Lambda Layer

⚠️ This repository is no longer maintained. See https://github.com/jcupitt/docker-builds for the best libvips Dockerfile implementation.


Fork of amazing ruby-vips-lambda project by customink with small Golang-related changes.

Usage

  • Clone or fork this repository.
  • Make sure you have Docker and AWS CLI installed.
  • Run ./bin/deploy

From there you simply use the arn in your AWS SAM template.yaml file.

Methodology

Simplicity and small file size! We followed the docs for libvips install. But because AWS Lambda already has ImageMagick and lots of the needed dependencies, the work was very basic.

We used the lambci/lambda:build-go1.x Docker image from the docker-lambda project. From there we only had to install a few more dependencies to get libvips installed. The current version is v8.8.4 and easy to configure if you need something else.

Lastly, we were happy to find that glib and gobject were already installed and all that was needed were some simple sym links so FFI could load these libraries.

Contents

Because of the way we build libvips by using existing libraries already installed on AWS Lambda, the resulting layer is very small. Only around 9MB in total un-compressed size.

$ ls -lAGp /opt/lib
total 9517
lrwxrwxrwx 1 root      27 Apr 15 20:46 libglib-2.0.so -> /usr/lib64/libglib-2.0.so.0
lrwxrwxrwx 1 root      30 Apr 15 20:46 libgobject-2.0.so -> /usr/lib64/libgobject-2.0.so.0
lrwxrwxrwx 1 root      17 Apr 15 20:46 libvips.so -> libvips.so.42.9.5
lrwxrwxrwx 1 root      17 Apr 15 20:46 libvips.so.42 -> libvips.so.42.9.5
-rwxr-xr-x 1 root 9745021 Apr 15 20:45 libvips.so.42.9.5

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 58.1%
  • Shell 41.9%