mirror of
https://github.com/lovell/sharp.git
synced 2025-12-06 20:11:40 +01:00
The --build-from-source flag is now deprecated and will soon be removed along with the need to define an install script. This will remove a whole category of package manager warnings about install scripts and "built" dependencies. Most people don't need to build sharp from source, but for those that do, a suitable method is now something like: $ npm install package-that-depends-on-sharp $ npm explore sharp -- npm run build
29 lines
796 B
Docker
29 lines
796 B
Docker
FROM ubuntu:25.04
|
|
ARG BRANCH=main
|
|
|
|
# Install basic dependencies
|
|
RUN apt-get -y update && apt-get install -y build-essential curl git ca-certificates gnupg
|
|
|
|
# Install latest Node.js LTS
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_24.x -o nodesource_setup.sh
|
|
RUN bash nodesource_setup.sh
|
|
RUN apt-get install -y nodejs
|
|
|
|
# Install benchmark dependencies
|
|
RUN apt-get install -y imagemagick libmagick++-dev graphicsmagick
|
|
|
|
# Install sharp
|
|
RUN mkdir /tmp/sharp
|
|
RUN cd /tmp && git clone --single-branch --branch $BRANCH https://github.com/lovell/sharp.git
|
|
RUN cd /tmp/sharp && npm install && npm run build
|
|
|
|
# Install benchmark test
|
|
RUN cd /tmp/sharp/test/bench && npm install --omit optional
|
|
|
|
RUN cat /etc/os-release | grep VERSION=
|
|
RUN node -v
|
|
|
|
WORKDIR /tmp/sharp/test/bench
|
|
|
|
CMD [ "node", "perf" ]
|