Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 3a5c506

Browse files
committed
Try to copy all the things.
1 parent ffbb1da commit 3a5c506

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ RUN cd ./libvips && \
6565
RUN mkdir -p share/lib && \
6666
cp -a $INSTALLDIR/lib/libvips.so* $WORKDIR/share/lib/
6767

68-
# Create sym links for ruby-ffi gem's `glib_libname` and `gobject_libname` to work.
68+
# Copy glib and gobject with their deps over.
6969
RUN cd ./share/lib/ && \
7070
cp /usr/lib64/libglib-2.0* . && \
71-
cp /usr/lib64/libgobject-2.0* .
71+
cp /usr/lib64/libgobject-2.0* . && \
72+
cp /usr/lib64/libgthread-2.0* . && \
73+
cp /usr/lib64/libgmodule-2.0* . && \
74+
cp /usr/lib64/libexpat* . && \
75+
ldconfig
7276

7377
# Zip up contents so final `lib` can be placed in /opt layer.
7478
#

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,38 @@ From there you simply use the arn in your AWS SAM `template.yaml` file.
2222

2323
Simplicity and small file size! We followed the [docs](https://libvips.github.io/libvips/install.html) for `libvips` install. But because AWS Lambda already has ImageMagick and lots of the needed dependencies, the work was very basic.
2424

25-
We used the `lambci/lambda:build-ruby2.7` Docker image from the [docker-lambda](https://github.com/lambci/docker-lambda) project. From there we only had to install a few more dependencies to get libvips installed. The current version is `v8.7.4` and easy to configure if you need something else.
25+
We used the `lambci/lambda:build-ruby2.7` Docker image from the [docker-lambda](https://github.com/lambci/docker-lambda) project. From there we only had to install a few more dependencies to get libvips installed. The current version is `v8.9.2` and easy to configure if you need something else.
2626

2727
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.
2828

2929

3030
## Contents
3131

32-
Because of the way we build `libvips` by using existing libraries already installed on AWS Lambda, the resulting layer is very small. Only around `10MB` in total un-compressed size.
32+
Current size of the layer's un-compressed contents is around `15MB` in size.
3333

3434
```shell
3535
$ ls -lAGp /opt/lib
36-
lrwxrwxrwx 1 root 27 Jan 30 18:08 libglib-2.0.so -> /usr/lib64/libglib-2.0.so.0
37-
lrwxrwxrwx 1 root 30 Jan 30 18:08 libgobject-2.0.so -> /usr/lib64/libgobject-2.0.so.0
38-
lrwxrwxrwx 1 root 18 Jan 30 18:08 libimagequant.so -> libimagequant.so.0
39-
-rw-r--r-- 1 root 56576 Jan 30 18:08 libimagequant.so.0
40-
lrwxrwxrwx 1 root 18 Jan 30 18:08 libvips.so -> libvips.so.42.12.1
41-
lrwxrwxrwx 1 root 18 Jan 30 18:08 libvips.so.42 -> libvips.so.42.12.1
42-
-rwxr-xr-x 1 root 9954128 Jan 30 18:08 libvips.so.42.12.1
36+
-rwxr-xr-x 1 root 201K Apr 27 20:30 libexpat.so
37+
-rwxr-xr-x 1 root 201K Apr 27 20:30 libexpat.so.1
38+
-rwxr-xr-x 1 root 201K Apr 27 20:30 libexpat.so.1.6.0
39+
-rwxr-xr-x 1 root 1.1M Apr 27 20:30 libglib-2.0.so
40+
-rwxr-xr-x 1 root 1.1M Apr 27 20:30 libglib-2.0.so.0
41+
-rwxr-xr-x 1 root 1.1M Apr 27 20:30 libglib-2.0.so.0.5600.1
42+
-rwxr-xr-x 1 root 15K Apr 27 20:30 libgmodule-2.0.so
43+
-rwxr-xr-x 1 root 15K Apr 27 20:30 libgmodule-2.0.so.0
44+
-rwxr-xr-x 1 root 15K Apr 27 20:30 libgmodule-2.0.so.0.5600.1
45+
-rwxr-xr-x 1 root 327K Apr 27 20:30 libgobject-2.0.so
46+
-rwxr-xr-x 1 root 327K Apr 27 20:30 libgobject-2.0.so.0
47+
-rwxr-xr-x 1 root 327K Apr 27 20:30 libgobject-2.0.so.0.5600.1
48+
-rwxr-xr-x 1 root 6.7K Apr 27 20:30 libgthread-2.0.so
49+
-rwxr-xr-x 1 root 6.7K Apr 27 20:30 libgthread-2.0.so.0
50+
-rwxr-xr-x 1 root 6.7K Apr 27 20:30 libgthread-2.0.so.0.5600.1
51+
lrwxrwxrwx 1 root 18B Apr 27 20:26 libimagequant.so -> libimagequant.so.0
52+
-rw-r--r-- 1 root 65K Apr 27 20:26 libimagequant.so.0
53+
lrwxrwxrwx 1 root 18B Apr 27 20:29 libvips.so -> libvips.so.42.12.2
54+
lrwxrwxrwx 1 root 18B Apr 27 20:29 libvips.so.42 -> libvips.so.42.12.2
55+
-rwxr-xr-x 1 root 9.6M Apr 27 20:29 libvips.so.42.12.2
4356

4457
$ ls -lAGp /opt/include
45-
-rw-r--r-- 1 root 6942 Jan 30 18:08 libimagequant.h
58+
-rw-r--r-- 1 root 6942 Jan 30 18:08 libimagequant.h
4659
```

bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
IMAGE_NAME=ruby-vips-lambda
6-
VIPS_VERSION=${VIPS_VERSION:=8.7.4}
6+
VIPS_VERSION=${VIPS_VERSION:=8.9.2}
77

88
rm -rf ./share
99
mkdir ./share

0 commit comments

Comments
 (0)