1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-22 12:00:05 +02:00
imgproxy/docker/Dockerfile

74 lines
2.2 KiB
Docker
Raw Normal View History

2024-10-25 22:29:44 +03:00
ARG BASE_IMAGE_VERSION="v3.12.0"
FROM darthsim/imgproxy-base:${BASE_IMAGE_VERSION} AS build
ENV CGO_ENABLED=1
2022-02-11 18:30:46 +06:00
2019-11-26 20:56:21 +06:00
COPY . .
2024-08-14 21:29:09 +03:00
RUN bash -c 'go build -v -ldflags "-s -w" -o /opt/imgproxy/bin/imgproxy'
# Remove unnecessary files
RUN rm -rf /opt/imgproxy/lib/pkgconfig /opt/imgproxy/lib/cmake
2018-11-08 16:34:21 +06:00
# ==================================================================================================
# AWS Lambda adapter
FROM public.ecr.aws/awsguru/aws-lambda-adapter:0.8.4 AS lambda-adapter
2018-11-08 16:34:21 +06:00
# ==================================================================================================
# Final image
2017-07-01 11:59:10 +06:00
FROM public.ecr.aws/ubuntu/ubuntu:noble
2018-10-25 22:25:54 +06:00
LABEL maintainer="Sergey Alexandrovich <darthsim@gmail.com>"
2019-11-26 20:56:21 +06:00
RUN apt-get update \
2021-09-30 20:20:47 +06:00
&& apt-get upgrade -y \
2024-06-25 18:01:22 +03:00
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
2019-10-02 18:49:05 +06:00
bash \
ca-certificates \
2023-10-06 00:06:12 +03:00
libstdc++6 \
2023-02-08 20:29:57 +03:00
fontconfig-config \
fonts-dejavu-core \
2022-09-07 16:50:21 +06:00
media-types \
libjemalloc2 \
libtcmalloc-minimal4 \
&& ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \
&& ln -s /usr/lib/$(uname -m)-linux-gnu/libtcmalloc_minimal.so.4 /usr/local/lib/libtcmalloc_minimal.so \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /etc/fonts/conf.d/10-sub-pixel-rgb.conf /etc/fonts/conf.d/11-lcdfilter-default.conf
2024-08-14 21:29:09 +03:00
COPY --from=build /opt/imgproxy/bin/imgproxy /opt/imgproxy/bin/
COPY --from=build /opt/imgproxy/lib /opt/imgproxy/lib
RUN ln -s /opt/imgproxy/bin/imgproxy /usr/local/bin/imgproxy
COPY docker/entrypoint.sh /usr/local/bin/
COPY docker/imgproxy-build-package /usr/local/bin/
# AWS Lambda adapter
COPY --from=lambda-adapter /lambda-adapter /opt/extensions/lambda-adapter
2024-08-14 21:29:09 +03:00
COPY NOTICE /opt/imgproxy/share/doc/
2019-03-21 18:47:17 +06:00
ENV VIPS_WARNING=0
ENV MALLOC_ARENA_MAX=2
ENV FONTCONFIG_PATH="/etc/fonts"
ENV IMGPROXY_MALLOC="malloc"
ENV AWS_LWA_READINESS_CHECK_PATH="/health"
ENV AWS_LWA_INVOKE_MODE="response_stream"
ENV AWS_LWA_ASYNC_INIT="true"
2019-03-21 18:47:17 +06:00
# Disable SVE on ARM64. SVE is slower than NEON on Amazon Graviton 3
ENV VIPS_VECTOR=167772160
RUN groupadd -r imgproxy \
&& useradd -r -u 999 -g imgproxy imgproxy \
&& mkdir -p /var/cache/fontconfig \
&& chmod 777 /var/cache/fontconfig
2021-11-25 19:35:56 +06:00
USER 999
2021-11-24 15:41:57 +06:00
ENTRYPOINT [ "entrypoint.sh" ]
2017-07-01 11:59:10 +06:00
CMD ["imgproxy"]
EXPOSE 8080