SoftCreatR / imei

IMEI - ImageMagick Easy Install
ISC License
305 stars 35 forks source link

Provide a "static" build option #23

Closed trajano closed 3 years ago

trajano commented 3 years ago

πŸš€ Feature

As noted in https://github.com/SoftCreatR/imei/issues/22#issuecomment-838729110 building extra libraries to a different directory may be difficult. Can we perhaps have an option to build binaries that embed the library inside so it can run on its own at the expense of having a larger image size.

My use case is to simply run Image Magick 7.x with HEIC support with OPENJDK's Dockerimage.

Have you spent some time to check if this issue has been raised before?

This is what I do, but it creates large image layer and it is slow on builds.

FROM openjdk:11-jdk
RUN apt-get update && \
  apt-get install -y ffmpeg && \
  curl -sL -o /tmp/imei dist.1-2.dev/imei && \
  bash /tmp/imei --no-sig-verify && \
  rm -rf /var/lib/apt/lists/*

What I wanted was

FROM ubuntu as imagemagick
RUN apt-get update -qq -y && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y git curl make cmake automake libtool yasm g++ pkg-config perl libde265-dev libx265-dev libltdl-dev libopenjp2-7-dev liblcms2-dev libbrotli-dev libzip-dev libbz2-dev liblqr-1-0-dev libzstd-dev libgif-dev libjpeg-dev libopenexr-dev libpng-dev libwebp-dev librsvg2-dev libwmf-dev libxml2-dev libtiff-dev libraw-dev ghostscript gsfonts ffmpeg libpango1.0-dev libdjvulibre-dev libfftw3-dev libgs-dev libgraphviz-dev libjemalloc-dev
RUN curl -sL -o  /imei.sh dist.1-2.dev/imei && \
  mkdir /work && \
  bash -x /imei.sh --no-sig-verify --build-dir /work && \
  rm -rf /var/lib/apt/lists/*

FROM openjdk:11-jre as imagemagick2
COPY --from=imagemagick /work /usr/local

Have you read the Code of Conduct?

[x] I have read the Code of Conduct

Pitch

(Please explain why this feature should be implemented and how it would be used. Add examples, if applicable.)

Note I just saw the update for work-dir so I am testing it out right now.