flyimg (amd64)
Published 2024-07-06 22:15:28 -05:00 by Korbs
Installation
docker pull ark.sudovanilla.org/korbs/flyimg:amd64
sha256:abd2b64bccbc81b3f9b79510f83dba5db03d170e6e0b0c411725ec48241e93ae
Image Layers
ADD file:0e5a7771d5c0c58072db41fa02f288def8a40f2116b48e6127f1034f848bc2cd in / |
CMD ["bash"] |
/bin/sh -c set -eux; { echo 'Package: php*'; echo 'Pin: release *'; echo 'Pin-Priority: -1'; } > /etc/apt/preferences.d/no-debian-php |
ENV PHPIZE_DEPS=autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c |
/bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends $PHPIZE_DEPS ca-certificates curl xz-utils ; rm -rf /var/lib/apt/lists/* |
ENV PHP_INI_DIR=/usr/local/etc/php |
/bin/sh -c set -eux; mkdir -p "$PHP_INI_DIR/conf.d"; [ ! -d /var/www/html ]; mkdir -p /var/www/html; chown www-data:www-data /var/www/html; chmod 1777 /var/www/html |
ENV PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 |
ENV PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 |
ENV PHP_LDFLAGS=-Wl,-O1 -pie |
ENV GPG_KEYS=39B641343D8C104B2B146DC3F9C39DC0B9698544 E60913E4DF209907D8E30D96659A97C9CF2A795A 1198C0117593497A5EC5C199286AF1F9897469DC |
ENV PHP_VERSION=8.2.18 |
ENV PHP_URL=https://www.php.net/distributions/php-8.2.18.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-8.2.18.tar.xz.asc |
ENV PHP_SHA256=44b306fc021e56441f691da6c3108788bd9e450f293b3bc70fcd64b08dd41a50 |
/bin/sh -c set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-recommends gnupg; rm -rf /var/lib/apt/lists/*; mkdir -p /usr/src; cd /usr/src; curl -fsSL -o php.tar.xz "$PHP_URL"; if [ -n "$PHP_SHA256" ]; then echo "$PHP_SHA256 *php.tar.xz" | sha256sum -c -; fi; if [ -n "$PHP_ASC_URL" ]; then curl -fsSL -o php.tar.xz.asc "$PHP_ASC_URL"; export GNUPGHOME="$(mktemp -d)"; for key in $GPG_KEYS; do gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; done; gpg --batch --verify php.tar.xz.asc php.tar.xz; gpgconf --kill all; rm -rf "$GNUPGHOME"; fi; apt-mark auto '.*' > /dev/null; apt-mark manual $savedAptMark > /dev/null; apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false |
COPY file:ce57c04b70896f77cc11eb2766417d8a1240fcffe5bba92179ec78c458844110 in /usr/local/bin/ |
/bin/sh -c set -eux; savedAptMark="$(apt-mark showmanual)"; apt-get update; apt-get install -y --no-install-recommends libargon2-dev libcurl4-openssl-dev libonig-dev libreadline-dev libsodium-dev libsqlite3-dev libssl-dev libxml2-dev zlib1g-dev ; export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" PHP_BUILD_PROVIDER='https://github.com/docker-library/php' PHP_UNAME='Linux - Docker' ; docker-php-source extract; cd /usr/src/php; gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; if [ ! -d /usr/include/curl ]; then ln -sT "/usr/include/$debMultiarch/curl" /usr/local/include/curl; fi; ./configure --build="$gnuArch" --with-config-file-path="$PHP_INI_DIR" --with-config-file-scan-dir="$PHP_INI_DIR/conf.d" --enable-option-checking=fatal --with-mhash --with-pic --enable-mbstring --enable-mysqlnd --with-password-argon2 --with-sodium=shared --with-pdo-sqlite=/usr --with-sqlite3=/usr --with-curl --with-iconv --with-openssl --with-readline --with-zlib --disable-phpdbg --with-pear $(test "$gnuArch" = 's390x-linux-gnu' && echo '--without-pcre-jit') --with-libdir="lib/$debMultiarch" --disable-cgi --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data ; make -j "$(nproc)"; find -type f -name '*.a' -delete; make install; find /usr/local -type f -perm '/0111' -exec sh -euxc ' strip --strip-all "$@" || : ' -- '{}' + ; make clean; cp -v php.ini-* "$PHP_INI_DIR/"; cd /; docker-php-source delete; apt-mark auto '.*' > /dev/null; [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; find /usr/local -type f -executable -exec ldd '{}' ';' | awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' | sort -u | xargs -r dpkg-query --search | cut -d: -f1 | sort -u | xargs -r apt-mark manual ; apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; rm -rf /var/lib/apt/lists/*; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version |
COPY multi:869bde9dbeae74886a05c9e2107b3e3b4877116db8c6d9adbaff2719f9fb5262 in /usr/local/bin/ |
/bin/sh -c docker-php-ext-enable sodium |
ENTRYPOINT ["docker-php-entrypoint"] |
WORKDIR /var/www/html |
/bin/sh -c set -eux; cd /usr/local/etc; if [ -d php-fpm.d ]; then sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; cp php-fpm.d/www.conf.default php-fpm.d/www.conf; else mkdir php-fpm.d; cp php-fpm.conf.default php-fpm.d/www.conf; { echo '[global]'; echo 'include=etc/php-fpm.d/*.conf'; } | tee php-fpm.conf; fi; { echo '[global]'; echo 'error_log = /proc/self/fd/2'; echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; echo; echo '[www]'; echo '; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.'; echo '; https://bugs.php.net/bug.php?id=73886'; echo 'access.log = /proc/self/fd/2'; echo; echo 'clear_env = no'; echo; echo '; Ensure worker stdout and stderr are sent to the main error log.'; echo 'catch_workers_output = yes'; echo 'decorate_workers_output = no'; } | tee php-fpm.d/docker.conf; { echo '[global]'; echo 'daemonize = no'; echo; echo '[www]'; echo 'listen = 9000'; } | tee php-fpm.d/zz-docker.conf; mkdir -p "$PHP_INI_DIR/conf.d"; { echo '; https://github.com/docker-library/php/issues/878#issuecomment-938595965'; echo 'fastcgi.logging = Off'; } > "$PHP_INI_DIR/conf.d/docker-fpm.ini" |
STOPSIGNAL SIGQUIT |
EXPOSE 9000 |
CMD ["php-fpm"] |
ENV DEBIAN_FRONTEND=noninteractive |
ARG IM_VERSION=7.1.1-32 |
ARG LIB_HEIF_VERSION=1.17.6 |
ARG LIB_AOM_VERSION=3.9.0 |
ARG LIB_WEBP_VERSION=1.4.0 |
ARG LIBJXL_VERSION=0.10.2 |
ARG TARGETPLATFORM |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCHITECTURE=arm; elif [ "$TARGETPLATFORM" = "linux/arm/v8" ]; then ARCHITECTURE=arm; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=aarch64; else ARCHITECTURE=amd64; fi && curl -sS -L -O --output-dir /tmp/ --create-dirs https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-${ARCHITECTURE}.tar.gz && tar xzf /tmp/s6-overlay-${ARCHITECTURE}.tar.gz -C / # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c apt-get -y update && apt-get install -y --no-install-recommends wget nginx libyaml-dev python3-distutils zip unzip git make pkg-config autoconf curl cmake clang libompl-dev ca-certificates automake yasm libde265-0 libde265-dev libjpeg62-turbo libjpeg62-turbo-dev x265 libx265-dev libtool libsdl1.2-dev libgif-dev libbrotli-dev webp opencv-data libpng16-16 libpng-dev libjpeg62-turbo libjpeg62-turbo-dev libgomp1 ghostscript ffmpeg libxml2-dev libxml2-utils libtiff-dev libfontconfig1-dev libfreetype6-dev fonts-dejavu liblcms2-2 liblcms2-dev libtcmalloc-minimal4 libxext6 libbrotli1 && export CC=clang CXX=clang++ && git clone -b v${LIBJXL_VERSION} https://github.com/libjxl/libjxl.git --depth 1 --recursive --shallow-submodules && cd libjxl && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. && cmake --build . -- -j$(nproc) && cmake --install . && cd ../../ && rm -rf libjxl && ldconfig /usr/local/lib && git clone -b v${LIB_WEBP_VERSION} --depth 1 https://chromium.googlesource.com/webm/libwebp && cd libwebp && mkdir build && cd build && cmake ../ && make && make install && make && make install && ldconfig /usr/local/lib && cd ../../ && rm -rf libwebp && git clone -b v${LIB_AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom && mkdir build_aom && cd build_aom && cmake ../aom/ -DAOM_TARGET_CPU=generic -DENABLE_TESTS=0 -DBUILD_SHARED_LIBS=1 && make && make install && ldconfig /usr/local/lib && cd .. && rm -rf aom && rm -rf build_aom && curl -L https://github.com/strukturag/libheif/releases/download/v${LIB_HEIF_VERSION}/libheif-${LIB_HEIF_VERSION}.tar.gz -o libheif.tar.gz && tar -xzvf libheif.tar.gz && cd libheif-${LIB_HEIF_VERSION}/ && mkdir build && cd build && cmake --preset=release .. && make && make install && cd ../../ ldconfig /usr/local/lib && rm -rf libheif-${LIB_HEIF_VERSION} && rm libheif.tar.gz && git clone -b ${IM_VERSION} --depth 1 https://github.com/ImageMagick/ImageMagick.git && cd ImageMagick && ./configure --without-magick-plus-plus --disable-docs --disable-static --with-tiff --with-jxl --with-tcmalloc && make && make install && ldconfig /usr/local/lib && rm -rf /ImageMagick # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c docker-php-ext-install opcache # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c pecl install yaml xdebug && echo "extension=yaml.so" > /usr/local/etc/php/conf.d/yaml.ini && echo "zend_extension=xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini && echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/xdebug.ini && echo "error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT" >> /usr/local/etc/php/conf.d/error_reporting.ini && echo "expose_php=off" > /usr/local/etc/php/conf.d/expose_php.ini # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c cd /opt && wget "https://github.com/mozilla/mozjpeg/archive/refs/tags/v4.1.1.tar.gz" && tar xvf "v4.1.1.tar.gz" && rm v4.1.1.tar.gz && mv mozjpeg-4.1.1 mozjpeg&& cd mozjpeg && cmake . && make # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c apt-get -y update && apt-get install -y python3-dev libssl-dev python3-opencv # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c cd /var && curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py && python3 get-pip.py && python3 -m pip install --upgrade pip && pip3 install numpy pillow && git clone https://github.com/flyimg/facedetect.git && chmod +x /var/facedetect/facedetect && ln -s /var/facedetect/facedetect /usr/local/bin/facedetect # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" -o "$TARGETPLATFORM" = "linux/arm64" ]; then pip3 install pillow-avif-plugin; fi # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c ldconfig /usr/local/lib # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c pip install git+https://github.com/flyimg/python-smart-crop # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c sed -i -e 's#access.log = /proc/self/fd/2#access.log = /proc/self/fd/1#g' /usr/local/etc/php-fpm.d/docker.conf # buildkit |
COPY resources/etc/ /etc/ # buildkit |
COPY resources/php-fpm.d/ /usr/local/etc/php-fpm.d/ # buildkit |
ENV PORT=80 |
COPY resources/docker-entrypoint.sh /usr/local/bin/docker-entrypoint # buildkit |
RUN |6 IM_VERSION=7.1.1-32 LIB_HEIF_VERSION=1.17.6 LIB_AOM_VERSION=3.9.0 LIB_WEBP_VERSION=1.4.0 LIBJXL_VERSION=0.10.2 TARGETPLATFORM=linux/amd64 /bin/sh -c chmod +x /usr/local/bin/docker-entrypoint # buildkit |
WORKDIR /var/www/html |
ENTRYPOINT ["docker-entrypoint" "/init"] |
COPY . /var/www/html # buildkit |
RUN /bin/sh -c usermod -u 1000 www-data && mkdir -p /var/www/html/var web/uploads/.tmb var/cache/ var/log/ && chown -R www-data:www-data var/ web/uploads/ && chmod 777 -R var/ web/uploads/ # buildkit |
RUN /bin/sh -c composer install --no-dev --optimize-autoloader # buildkit |