pece-drupal (latest)

Published 2024-12-21 01:20:56 +00:00 by wolcen

Installation

docker pull git.agaric.com/agaric/pece-drupal:latest
sha256:13cd7e461cb2307a25e3dcc47e98af77356b333ead006ea8c0a7a43308d561c3

Image Layers

ADD alpine-minirootfs-3.20.3-x86_64.tar.gz / # buildkit
CMD ["/bin/sh"]
ENV PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
RUN /bin/sh -c apk add --no-cache ca-certificates curl openssl tar xz # buildkit
RUN /bin/sh -c set -eux; adduser -u 82 -D -S -G www-data www-data # buildkit
ENV PHP_INI_DIR=/usr/local/etc/php
RUN /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 # buildkit
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=1198C0117593497A5EC5C199286AF1F9897469DC C28D937575603EB4ABB725861C0779DC5C0A9DE4 AFD8691FDAEDF03BDF6E460563F15A9B715376CA
ENV PHP_VERSION=8.3.14
ENV PHP_URL=https://www.php.net/distributions/php-8.3.14.tar.xz PHP_ASC_URL=https://www.php.net/distributions/php-8.3.14.tar.xz.asc
ENV PHP_SHA256=58b4cb9019bf70c0cbcdb814c7df79b9065059d14cf7dbf48d971f8e56ae9be7
RUN /bin/sh -c set -eux; apk add --no-cache --virtual .fetch-deps gnupg; 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; apk del --no-network .fetch-deps # buildkit
COPY docker-php-source /usr/local/bin/ # buildkit
RUN /bin/sh -c set -eux; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS argon2-dev coreutils curl-dev gnu-libiconv-dev libsodium-dev libxml2-dev linux-headers oniguruma-dev openssl-dev readline-dev sqlite-dev ; rm -vf /usr/include/iconv.h; 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)"; ./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=/usr --with-openssl --with-readline --with-zlib --disable-phpdbg --with-pear --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; runDeps="$( scanelf --needed --nobanner --format '%n#p' --recursive /usr/local | tr ',' '\n' | sort -u | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' )"; apk add --no-cache $runDeps; apk del --no-network .build-deps; pecl update-channels; rm -rf /tmp/pear ~/.pearrc; php --version # buildkit
COPY docker-php-ext-* docker-php-entrypoint /usr/local/bin/ # buildkit
RUN /bin/sh -c docker-php-ext-enable sodium # buildkit
ENTRYPOINT ["docker-php-entrypoint"]
WORKDIR /var/www/html
RUN /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" # buildkit
STOPSIGNAL SIGQUIT
EXPOSE map[9000/tcp:{}]
CMD ["php-fpm"]
ARG PHP_DEV=
ARG PECL_HTTP_PROXY=
ARG WODBY_USER_ID=1000
ARG WODBY_GROUP_ID=1000
ENV PHP_DEV=
ENV APP_ROOT=/var/www/html CONF_DIR=/var/www/conf FILES_DIR=/mnt/files
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/wodby/.composer/vendor/bin:/var/www/html/vendor/bin:/var/www/html/bin SSHD_HOST_KEYS_DIR=/etc/ssh ENV=/home/wodby/.shrc GIT_USER_EMAIL=wodby@example.com GIT_USER_NAME=wodby PHP_EXTENSIONS_DISABLE=xdebug,xhprof,spx
ARG TARGETPLATFORM=linux/amd64
ARG TARGETARCH=amd64
COPY patches /tmp/patches # buildkit
RUN |6 PHP_DEV= PECL_HTTP_PROXY= WODBY_USER_ID=1000 WODBY_GROUP_ID=1000 TARGETPLATFORM=linux/amd64 TARGETARCH=amd64 /bin/sh -c set -xe; existing_group=$(getent group "${WODBY_GROUP_ID}" | cut -d: -f1); if [[ -n "${existing_group}" ]]; then delgroup "${existing_group}"; fi; existing_user=$(getent passwd "${WODBY_USER_ID}" | cut -d: -f1); if [[ -n "${existing_user}" ]]; then deluser "${existing_user}"; fi; apk add --update --no-cache shadow; groupadd -g "${WODBY_GROUP_ID}" wodby; useradd -u "${WODBY_USER_ID}" -m -s /bin/bash -g wodby wodby; adduser wodby www-data; sed -i '/^wodby/s/!/*/' /etc/shadow; apk add --update --no-cache -t .wodby-php-run-deps p7zip bash brotli-libs c-client curl fcgi findutils freetype git gmp gzip icu-libs icu-data-full imagemagick imagemagick-heic imagemagick-jpeg imagemagick-pdf imagemagick-svg imagemagick-tiff imagemagick-webp jpegoptim less libavif libbz2 libevent libgd libgomp libjpeg-turbo libjpeg-turbo-utils libldap libltdl libmemcached-libs libmcrypt libpng librdkafka libsmbclient libuuid libwebp libxml2 libxslt libzip make mariadb-client mariadb-connector-c msmtp nano openssh openssh-client patch pngquant postgresql-client rabbitmq-c rsync sqlite ssmtp su-exec sudo tar tidyhtml-libs tig tmux unzip wget yaml; if [[ -n "${PHP_DEV}" ]]; then apk add --update --no-cache -t .wodby-php-dev-run-deps yarn; fi; apk add --update --no-cache -t .wodby-php-build-deps autoconf automake binutils cmake brotli-dev build-base bzip2-dev freetype-dev gd-dev gmp-dev icu-dev imap-dev imagemagick-dev jpeg-dev krb5-dev libavif-dev libevent-dev libgcrypt-dev libjpeg-turbo-dev libmemcached-dev libmcrypt-dev libpng-dev librdkafka-dev libtool libwebp-dev libxslt-dev libzip-dev linux-headers openldap-dev openssl-dev pcre-dev postgresql-dev rabbitmq-c-dev samba-dev sqlite-dev tidyhtml-dev unixodbc-dev yaml-dev zlib-dev; apk add --update --no-cache redis; mv /usr/bin/redis-cli /tmp/; apk del --purge redis; deluser redis; mv /tmp/redis-cli /usr/bin; dockerplatform=${TARGETPLATFORM:-linux/amd64}; gotpl_url="https://github.com/wodby/gotpl/releases/latest/download/gotpl-${dockerplatform/\//-}.tar.gz"; wget -qO- "${gotpl_url}" | tar xz --no-same-owner -C /usr/local/bin; git clone https://github.com/wodby/alpine /tmp/alpine; cd /tmp/alpine; latest=$(git describe --abbrev=0 --tags); git checkout "${latest}"; mv /tmp/alpine/bin/* /usr/local/bin; docker-php-source extract; cp /usr/src/php/php.ini-production "${PHP_INI_DIR}/php.ini"; NPROC=$(getconf _NPROCESSORS_ONLN); docker-php-ext-install "-j${NPROC}" bcmath bz2 calendar exif gmp intl ldap mysqli opcache pcntl pdo_mysql pdo_pgsql pgsql soap sockets tidy xsl zip; cd /usr/src/php/ext/; git clone https://github.com/Imagick/imagick; cd imagick; git reset --hard 28f27044e435a2b203e32675e942eb8de620ee58; for i in /tmp/patches/imagick/*.patch; do patch -p1 -i "${i}"; done; docker-php-ext-configure imagick; docker-php-ext-install "-j${NPROC}" imagick; docker-php-ext-configure gd --with-external-gd --with-webp --with-freetype --with-avif --with-jpeg; docker-php-ext-install "-j${NPROC}" gd; pecl config-set php_ini "${PHP_INI_DIR}/php.ini"; if [[ -n "${PECL_HTTP_PROXY}" ]]; then pear config-set http_proxy "${PECL_HTTP_PROXY}"; fi; arch=${TARGETARCH:-amd64}; baseurl="https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5"; curl -O "${baseurl}/msodbcsql18_18.3.1.1-1_${arch}.apk" && apk add --allow-untrusted "msodbcsql18_18.3.1.1-1_${arch}.apk"; curl -O "${baseurl}/mssql-tools18_18.3.1.1-1_${arch}.apk" && apk add --allow-untrusted "mssql-tools18_18.3.1.1-1_${arch}.apk"; ln -sfnv /opt/mssql-tools*/bin/* /usr/bin; rm ./*.apk; if [[ "${PHP_VERSION:0:3}" == "8.1" || "${PHP_VERSION:0:3}" == "8.2" || "${PHP_VERSION:0:3}" == "8.3" ]]; then PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl; docker-php-ext-install "-j${NPROC}" imap; fi; MAKEFLAGS="-j ${NPROC}" pecl install apcu-5.1.24 amqp-2.1.2 ast-1.1.2 ds-1.5.0 event-3.1.4 grpc-1.68.0 igbinary-3.2.16 $(test "${PHP_VERSION:0:3}" == "8.4" && echo 'imap-1.0.3') memcached-3.2.0 mongodb-1.20.0 oauth-2.0.9 opentelemetry-1.1.0 pdo_sqlsrv-5.12.0 $(test "${PHP_VERSION:0:3}" != "8.4" && echo 'pcov') rdkafka-6.0.5 redis-6.1.0 sqlsrv-5.12.0 smbclient-1.1.1 uploadprogress-2.0.2 uuid-1.2.1 $(test "${PHP_VERSION:0:3}" == "8.4" && echo 'xdebug-3.4.0beta1' || echo 'xdebug-3.3.2') xhprof-2.3.10 yaml-2.2.4; docker-php-ext-enable apcu amqp ast ds event igbinary imap grpc memcached mongodb oauth opentelemetry pdo_sqlsrv $(test "${PHP_VERSION:0:3}" != "8.4" && echo 'pcov') rdkafka redis smbclient sqlsrv uploadprogress uuid xdebug xhprof yaml; mv /usr/local/etc/php/conf.d/docker-php-ext-event.ini /usr/local/etc/php/conf.d/z-docker-php-ext-event.ini; if [[ "${PHP_VERSION:0:3}" != "8.4" ]]; then newrelic_url="http://download.newrelic.com/php_agent/release/"; wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1; tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic; export NR_INSTALL_SILENT=true; export NR_INSTALL_USE_CP_NOT_LN=true; bash /tmp/newrelic/newrelic-install install; rm -f /usr/local/etc/php/conf.d/newrelic.ini; mkdir -p /var/log/newrelic/; chown -R www-data:www-data /var/log/newrelic/; chmod -R 775 /var/log/newrelic/; fi; brotli_ext_ver="0.15.2"; mkdir -p /usr/src/php/ext/brotli; brotli_url="https://github.com/kjdev/php-ext-brotli/archive/refs/tags/${brotli_ext_ver}.tar.gz"; wget -qO- "${brotli_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/brotli; docker-php-ext-configure brotli --with-libbrotli; docker-php-ext-install "-j${NPROC}" brotli; spx_ext_ver="0.4.17"; mkdir -p /usr/src/php/ext/spx; spx_url="https://github.com/NoiseByNorthwest/php-spx/archive/refs/tags/v${spx_ext_ver}.tar.gz"; wget -qO- "${spx_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/spx; docker-php-ext-configure spx; docker-php-ext-install "-j${NPROC}" spx; wget -qO- https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer; walter_ver="1.4.0"; walter_url="https://github.com/walter-cd/walter/releases/download/v${walter_ver}/walter_${walter_ver}_linux_amd64.tar.gz"; wget -qO- "${walter_url}" | tar xz -C /tmp/; mv /tmp/walter_linux_amd64/walter /usr/local/bin; { echo 'export PS1="\u@${WODBY_APP_NAME:-php}.${WODBY_ENVIRONMENT_NAME:-container}:\w $ "'; echo "export PATH=${PATH}"; } | tee /home/wodby/.shrc; cp /home/wodby/.shrc /home/wodby/.bashrc; cp /home/wodby/.shrc /home/wodby/.bash_profile; { echo 'Defaults env_keep += "APP_ROOT FILES_DIR"' ; if [[ -n "${PHP_DEV}" ]]; then echo 'wodby ALL=(root) NOPASSWD:SETENV:ALL'; else echo -n 'wodby ALL=(root) NOPASSWD:SETENV: ' ; echo -n '/usr/local/bin/files_chmod, ' ; echo -n '/usr/local/bin/files_chown, ' ; echo -n '/usr/local/bin/files_sync, ' ; echo -n '/usr/local/bin/gen_ssh_keys, ' ; echo -n '/usr/local/bin/init_container, ' ; echo -n '/usr/local/bin/migrate, ' ; echo -n '/usr/local/sbin/php-fpm, ' ; echo -n '/usr/sbin/sshd, ' ; echo '/usr/sbin/crond' ; fi; } | tee /etc/sudoers.d/wodby; echo "TLS_CACERTDIR /etc/ssl/certs/" >> /etc/openldap/ldap.conf; install -o wodby -g wodby -d "${APP_ROOT}" "${CONF_DIR}" /home/wodby/.ssh; install -o www-data -g www-data -d "${FILES_DIR}/public" "${FILES_DIR}/private" "${FILES_DIR}/sessions" "${FILES_DIR}/xhprof" "${FILES_DIR}/xdebug" "${FILES_DIR}/spx" /home/www-data/.ssh; touch /etc/msmtprc; chmod -R 775 "${FILES_DIR}"; chown -R wodby:wodby "${PHP_INI_DIR}/conf.d" /usr/local/etc/php-fpm.d /etc/ssmtp/ssmtp.conf /etc/msmtprc /home/wodby/.[^.]*; touch /etc/ssh/sshd_config /etc/gitconfig; chown wodby: /etc/ssh/sshd_config /etc/gitconfig; chown wodby:wodby /usr/local/bin/ /usr/local/bin/composer; rm /etc/crontabs/root; touch /etc/crontabs/www-data; chown root:www-data /etc/crontabs/www-data; chmod 660 /etc/crontabs/www-data; if [[ -z "${PHP_DEV}" ]]; then strip --strip-debug /usr/local/lib/php/extensions/no-debug-non-zts-*/*.so; docker-php-source delete; rm -rf /usr/src/; fi; su-exec wodby composer clear-cache; apk del --purge .wodby-php-build-deps; pecl clear-cache; rm -rf /usr/include/php /usr/lib/php/build /tmp/* /root/.composer /var/cache/apk/* # buildkit
USER wodby
WORKDIR /var/www/html
EXPOSE map[9000/tcp:{}]
COPY templates /etc/gotpl/ # buildkit
COPY docker-entrypoint.sh / # buildkit
COPY bin /usr/local/bin/ # buildkit
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["sudo" "-E" "php-fpm"]
ENV PHP_REALPATH_CACHE_TTL=3600 PHP_OUTPUT_BUFFERING=16384 PHP_APCU_SHM_SIZE=256M
USER root
RUN /bin/sh -c set -ex; mv /usr/local/bin/actions.mk /usr/local/bin/php.mk; sed -i 's/git-checkout:/php-git-checkout:/' /usr/local/bin/php.mk; mkdir -p "${FILES_DIR}/config"; chown www-data:www-data "${FILES_DIR}/config"; chmod 775 "${FILES_DIR}/config"; su-exec wodby composer clear-cache # buildkit
USER wodby
COPY templates /etc/gotpl/ # buildkit
COPY bin /usr/local/bin # buildkit
COPY init /docker-entrypoint-init.d/ # buildkit
ARG UID=1000
ARG GID=100
WORKDIR /var/www/html
USER 1000:100
COPY --chown=1000:100 . . # buildkit
USER root
COPY drupal10.settings.php.tmpl /etc/gotpl/ # buildkit
RUN |2 UID=1000 GID=100 composer install --no-dev --optimize-autoloader # buildkit
RUN |2 UID=1000 GID=100 ln -s /mnt/files/public /var/www/html/web/sites/default/files # buildkit
RUN |2 UID=1000 GID=100 ln -s /mnt/files/private /var/www/html/private # buildkit
RUN |2 UID=1000 GID=100 chown -R wodby:wodby /var/www/html # buildkit
USER wodby
RUN |2 UID=1000 GID=100 composer clear-cache # buildkit
Details
Container
2024-12-21 01:20:56 +00:00
2
OCI / Docker
linux/amd64
444 MiB
Versions (1) View all
latest 2024-12-21