1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00
imgproxy/docker/Dockerfile

123 lines
2.8 KiB
Docker
Raw Normal View History

2019-11-26 16:56:21 +02:00
FROM golang:1-buster
2018-10-25 18:25:54 +02:00
LABEL maintainer="Sergey Alexandrovich <darthsim@gmail.com>"
2017-07-01 07:59:10 +02:00
ARG VIPS_VERSION=8.9.1
ARG IMAGEMAGICK_VERSION=7.0.9-20
2019-11-26 16:56:21 +02:00
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
ENV LD_LIBRARY_PATH /lib64:/usr/lib64:/usr/local/lib
ENV CGO_LDFLAGS_ALLOW "-s|-w"
2017-07-01 07:59:10 +02:00
2018-11-08 12:34:21 +02:00
# Install dependencies
2019-11-26 16:56:21 +02:00
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
2019-10-02 14:49:05 +02:00
curl \
git \
ca-certificates \
2019-11-26 16:56:21 +02:00
build-essential \
2019-10-02 14:49:05 +02:00
libtool \
2019-11-26 16:56:21 +02:00
libfftw3-dev \
libglib2.0-dev \
libexpat1-dev \
libjpeg62-turbo-dev \
2019-10-02 14:49:05 +02:00
libpng-dev \
libwebp-dev \
2019-11-26 16:56:21 +02:00
libgif-dev \
librsvg2-dev \
2019-10-02 14:49:05 +02:00
libexif-dev \
2019-11-26 16:56:21 +02:00
liblcms2-dev \
2019-10-02 14:49:05 +02:00
libheif-dev \
2019-11-26 16:56:21 +02:00
libtiff-dev \
libimagequant-dev
2018-11-08 12:34:21 +02:00
# Build ImageMagick
RUN cd /root \
&& curl -Ls https://github.com/ImageMagick/ImageMagick/archive/$IMAGEMAGICK_VERSION.tar.gz | tar -xz \
&& cd ImageMagick-$IMAGEMAGICK_VERSION \
2018-11-08 12:34:21 +02:00
&& ./configure \
--enable-silent-rules \
--disable-static \
--disable-openmp \
--disable-deprecated \
--disable-docs \
--with-threads \
--without-magick-plus-plus \
--without-utilities \
--without-perl \
--without-bzlib \
--without-dps \
--without-freetype \
--without-fontconfig \
2018-11-08 12:34:21 +02:00
--without-jbig \
--without-jpeg \
--without-lcms \
--without-lzma \
--without-png \
--without-tiff \
--without-wmf \
--without-xml \
--without-webp \
--without-heic \
--without-pango \
2019-11-26 16:56:21 +02:00
&& make install-strip \
&& rm -rf /usr/local/lib/libMagickWand-7.*
2018-11-08 12:34:21 +02:00
# Build libvips
RUN cd /root \
&& curl -Ls https://github.com/libvips/libvips/releases/download/v$VIPS_VERSION/vips-$VIPS_VERSION.tar.gz | tar -xz \
&& cd vips-$VIPS_VERSION \
&& ./configure \
--without-python \
--without-OpenEXR \
--enable-debug=no \
--disable-static \
2019-11-26 16:56:21 +02:00
--disable-introspection \
2018-11-08 12:34:21 +02:00
--enable-silent-rules \
2019-11-26 16:56:21 +02:00
&& make install-strip \
&& rm -rf /usr/local/lib/libvips-cpp.*
2018-11-08 12:34:21 +02:00
2019-09-17 11:10:38 +02:00
WORKDIR /app
2019-11-26 16:56:21 +02:00
COPY . .
2018-11-08 12:34:21 +02:00
# Build imgproxy
2019-11-26 16:56:21 +02:00
RUN go build -v -o /usr/local/bin/imgproxy
2018-11-08 12:34:21 +02:00
# ==================================================================================================
# Final image
2017-07-01 07:59:10 +02:00
2019-11-26 16:56:21 +02:00
FROM debian:buster-slim
2018-10-25 18:25:54 +02:00
LABEL maintainer="Sergey Alexandrovich <darthsim@gmail.com>"
2019-11-26 16:56:21 +02:00
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
2019-10-02 14:49:05 +02:00
bash \
ca-certificates \
2019-11-26 16:56:21 +02:00
libsm6 \
libfftw3-3 \
libglib2.0-0 \
libexpat1 \
libjpeg62-turbo \
libpng16-16 \
libwebp6 \
libwebpmux3 \
libwebpdemux2 \
libgif7 \
librsvg2-2 \
libexif12 \
liblcms2-2 \
libheif1 \
libtiff5 \
libimagequant0 \
&& rm -rf /var/lib/apt/lists/*
2018-11-08 12:34:21 +02:00
COPY --from=0 /usr/local/bin/imgproxy /usr/local/bin/
2019-11-26 16:56:21 +02:00
COPY --from=0 /usr/local/lib /usr/local/lib
2019-03-21 14:47:17 +02:00
ENV VIPS_WARNING=0
ENV MALLOC_ARENA_MAX=2
2019-11-26 16:56:21 +02:00
ENV LD_LIBRARY_PATH /lib64:/usr/lib64:/usr/local/lib
2019-03-21 14:47:17 +02:00
2017-07-01 07:59:10 +02:00
CMD ["imgproxy"]
EXPOSE 8080