Intervox/node-webp

Failed to run on Docker & Linux Alpine

Closed this issue · 3 comments

Docker (node:8-alpine)

Run script https://raw.githubusercontent.com/Intervox/node-webp/latest/bin/install_webp

When called on node, it produce following error :
Error: spawn cwebp ENOENT

I tried to install dependencies with no effect (specified at https://developers.google.com/speed/webp/docs/precompiled see "Note (for Linux and Mac OS X)") :
libjpeg / libpng / tiff / libjpeg-turbo-dev / libpng-dev / tiff-dev / giflib-dev / giflib

An alternative way (which work) is to build from sources (in script maybe ?). See https://developers.google.com/speed/webp/docs/compiling#unix

I've just checked install_webp script on Alpine Linux and could confirm that it fails to install webp tools correctly.
Right now install_webp downloads official precompiled binaries and unpacks them to correct locations. For some reason it doesn't work for Alpine.
But since I don't fully understand the problem, I won't be able to fix it.

I could suggest several possible solutions for your problem.

First, you could install libwebp-tools package using apk:

apk add --no-cache --update libwebp-tools

Currently it installs webp@0.6.0.

Second, you could build webp from source using the following code snippet:

apk add --no-cache --update libpng-dev libjpeg-turbo-dev giflib-dev tiff-dev autoconf automake make gcc g++ wget

wget --no-check-certificate https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.0.0.tar.gz && \
  tar -xvzf libwebp-1.0.0.tar.gz && \
  cd libwebp-1.0.0 && \
  ./configure && \
  make && \
  make install && \
  cd .. && \
  rm -rf libwebp-1.0.0 libwebp-1.0.0.tar.gz

@Dean79000 you may also consider opening a separate issue on WebP Tracker to let them know that precompiled WebP binaries fail on Alpine Linux.

Closing this issue for now.