Sharp: Building sharp with libvips 8.7.1?

Created on 21 Nov 2018  路  4Comments  路  Source: lovell/sharp

I'm running sharp in an Alpine Docker container and libvips has problem writing to /tmp. It looks like this is fixed (by Lovell): https://github.com/lovell/sharp/issues/1436

Setting VIPS_DISC_THRESHOLD to a really high number makes it work, but this doesn't seem like a stable workaround.

Is there any way of building sharp with libvips 8.7.1? Or even better, are there any plans to include 8.7.1 in sharp?

Edit:
BTW, thank you soo much for this awesome library!

question

Most helpful comment

sharp will look for a globally-installed version of libvips that meets a required minimum. If it fails to find this it will download and use pre-built binaries of that version. These decisions are logged during npm install.

Installing a specific version of libvips globally before npm install is run against a lockfile will provide a reproducible build.

All 4 comments

Hello, sharp will look for and use a globally-installed version of libvips. If you need libvips v8.7.1 you can build it from source, install globally then rebuild sharp.

Thanks a bunch!
Do you know how building from source would affect my package-lock.json?

Edit:
I suppose I'd have to live with not locking down this dep?
Should I do a separate npm install --build-from-source sharp after my regular npm install in my Dockerfile?

sharp will look for a globally-installed version of libvips that meets a required minimum. If it fails to find this it will download and use pre-built binaries of that version. These decisions are logged during npm install.

Installing a specific version of libvips globally before npm install is run against a lockfile will provide a reproducible build.

Was this page helpful?
0 / 5 - 0 ratings