|
| 1 | +FROM php:8.3-rc-alpine |
| 2 | + |
| 3 | +# disable interactive functions |
| 4 | +ENV DEBIAN_FRONTEND noninteractive |
| 5 | + |
| 6 | +RUN apk --no-cache add libzip-dev && \ |
| 7 | + apk --no-cache --update add --virtual .build-deps gcc make g++ zlib-dev libmcrypt-dev libxml2-dev libzip-dev curl git zip unzip oniguruma-dev autoconf && \ |
| 8 | + rm -rf /var/cache/apk/* |
| 9 | + |
| 10 | +RUN docker-php-ext-install \ |
| 11 | + mbstring \ |
| 12 | + zip \ |
| 13 | + pdo_mysql \ |
| 14 | + mysqli \ |
| 15 | + xml \ |
| 16 | + bcmath |
| 17 | + |
| 18 | +RUN apk add icu-dev && \ |
| 19 | + docker-php-ext-configure intl && \ |
| 20 | + docker-php-ext-install intl && \ |
| 21 | + rm -rf /var/cache/apk/* |
| 22 | + |
| 23 | +# Install PHP Code Sniffer |
| 24 | +RUN curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o phpcs && \ |
| 25 | + curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar -o phpcbf && \ |
| 26 | + chmod a+x phpcs && \ |
| 27 | + chmod a+x phpcbf && \ |
| 28 | + mv phpcs /usr/local/bin/phpcs && \ |
| 29 | + mv phpcbf /usr/local/bin/phpcbf |
| 30 | + |
| 31 | +# Install PHP Copy Paste Detector |
| 32 | +RUN curl -L https://phar.phpunit.de/phpcpd.phar -o phpcpd.phar && \ |
| 33 | + chmod +x phpcpd.phar && \ |
| 34 | + mv phpcpd.phar /usr/local/bin/phpcpd |
| 35 | + |
| 36 | +# Install PHP Dead Code Detector |
| 37 | +RUN curl -L https://phar.phpunit.de/phpdcd.phar -o phpdcd.phar && \ |
| 38 | + chmod +x phpdcd.phar && \ |
| 39 | + mv phpdcd.phar /usr/local/bin/phpdcd |
| 40 | + |
| 41 | +# Install Composer |
| 42 | +RUN curl -sS https://getcomposer.org/installer -o composer-setup.php && \ |
| 43 | + php composer-setup.php --install-dir=/usr/local/bin --filename=composer |
| 44 | + |
| 45 | +# Install PhpMetrics |
| 46 | +RUN curl -OL https://github.com/phpmetrics/PhpMetrics/releases/download/v2.3.2/phpmetrics.phar && \ |
| 47 | + chmod +x phpmetrics.phar && mv phpmetrics.phar /usr/local/bin/phpmetrics |
| 48 | + |
| 49 | +# Install phpcs-security-audit v2 sniffes |
| 50 | +RUN mkdir -p /opt/phpcs/snifss/ && \ |
| 51 | + cd /opt/phpcs/snifss/ && \ |
| 52 | + git clone -b master https://github.com/FloeDesignTechnologies/phpcs-security-audit.git phpcs-security-audit && \ |
| 53 | + phpcs --config-set installed_paths /opt/phpcs/snifss/phpcs-security-audit/ |
| 54 | + |
| 55 | +# Create tools folder |
| 56 | +RUN mkdir -p /tools |
| 57 | + |
| 58 | +# Set global bin-dir for composer packages |
| 59 | +ENV COMPOSER_BIN_DIR="/usr/local/bin" |
| 60 | + |
| 61 | +# Install Psecio Parse |
| 62 | +RUN mkdir -p /tools/psecio/parse && \ |
| 63 | + cd /tools/psecio/parse && \ |
| 64 | + composer require --dev psecio/parse && \ |
| 65 | + cd - |
| 66 | + |
| 67 | +# Install PHP-Var-Dump-Check |
| 68 | +RUN mkdir -p /tools/php-parallel-lint/php-var-dump-check && \ |
| 69 | + cd /tools/php-parallel-lint/php-var-dump-check && \ |
| 70 | + composer require --dev php-parallel-lint/php-var-dump-check && \ |
| 71 | + cd - |
| 72 | + |
| 73 | +# Install PHP-Parallel-Lint |
| 74 | +RUN mkdir -p /tools/php-parallel-lint/php-parallel-lint && \ |
| 75 | + cd /tools/php-parallel-lint/php-parallel-lint && \ |
| 76 | + composer require --dev php-parallel-lint/php-parallel-lint && \ |
| 77 | + cd - |
| 78 | + |
| 79 | +# Install PHP Assumptions |
| 80 | +RUN mkdir -p /tools/rskuipers/php-assumptions && \ |
| 81 | + cd /tools/rskuipers/php-assumptions && \ |
| 82 | + composer require --dev rskuipers/php-assumptions && \ |
| 83 | + cd - |
| 84 | + |
| 85 | +# Install churn-php |
| 86 | +RUN mkdir -p /tools/bmitch/churn-php && \ |
| 87 | + cd /tools/bmitch/churn-php && \ |
| 88 | + composer require --dev bmitch/churn-php && \ |
| 89 | + cd - |
| 90 | + |
| 91 | +# Install Fink |
| 92 | +RUN mkdir -p /tools/dantleech/fink && \ |
| 93 | + cd /tools/dantleech/fink && \ |
| 94 | + composer require --dev dantleech/fink && \ |
| 95 | + cd - |
| 96 | + |
| 97 | +# Install Pint |
| 98 | +RUN mkdir -p /tools/laravel/pint && \ |
| 99 | + cd /tools/laravel/pint && \ |
| 100 | + composer require laravel/pint --dev && \ |
| 101 | + cd - |
| 102 | + |
| 103 | +# Add update script |
| 104 | +ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/update.sh /update.sh |
| 105 | +RUN chmod +x /update.sh |
| 106 | + |
| 107 | +# Add gitignore check script |
| 108 | +ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/gitignore_checker.sh /gitignore_checker.sh |
| 109 | +RUN chmod +x /gitignore_checker.sh && ln -s /gitignore_checker.sh /usr/local/bin/gitignore_checker |
| 110 | + |
| 111 | +# Add merge conflict checker script |
| 112 | +ADD https://raw.githubusercontent.com/umutphp/php-docker-images-for-ci/master/scripts/merge_conflict_checker.sh /merge_conflict_checker.sh |
| 113 | +RUN chmod +x /merge_conflict_checker.sh && ln -s /merge_conflict_checker.sh /usr/local/bin/merge_conflict_checker |
| 114 | + |
| 115 | +# Install PHPMD |
| 116 | +RUN mkdir -p /tools/phpmd/phpmd && \ |
| 117 | + cd /tools/phpmd/phpmd && \ |
| 118 | + composer require --dev phpmd/phpmd && \ |
| 119 | + cd - |
| 120 | + |
| 121 | +# Install PHP_Testability |
| 122 | +RUN mkdir -p /tools/edsonmedina/php_testability && \ |
| 123 | + cd /tools/edsonmedina/php_testability && \ |
| 124 | + composer require --dev edsonmedina/php_testability:dev-master && \ |
| 125 | + cd - |
| 126 | + |
| 127 | +# Install composer-normalize |
| 128 | +RUN composer global config --no-plugins allow-plugins.ergebnis/composer-normalize true && composer global require ergebnis/composer-normalize |
| 129 | + |
| 130 | +# Install infection/infection for mutation testing |
| 131 | +RUN apk add --update linux-headers && rm -rf /var/cache/apk/* |
| 132 | +RUN pecl install xdebug && docker-php-ext-enable xdebug && docker-php-ext-configure zip && docker-php-ext-install zip |
| 133 | +RUN composer global config --no-plugins allow-plugins.infection/extension-installer true && composer global require infection/infection |
| 134 | + |
| 135 | +# Install Deptrac |
| 136 | +RUN mkdir -p /tools/deptrac && \ |
| 137 | + curl -LS https://github.com/sensiolabs-de/deptrac/releases/download/0.6.0/deptrac.phar -o deptrac.phar && \ |
| 138 | + chmod +x deptrac.phar && mv deptrac.phar /tools/deptrac/deptrac |
| 139 | + |
| 140 | +# Install phpstan |
| 141 | +RUN mkdir -p /tools/phpstan/phpstan && \ |
| 142 | + cd /tools/phpstan/phpstan && \ |
| 143 | + composer require --dev phpstan/phpstan && \ |
| 144 | + cd - |
| 145 | + |
| 146 | +# Remove build dependencies |
| 147 | +RUN apk del .build-deps |
| 148 | + |
| 149 | +# Install local-php-security-checker |
| 150 | +RUN mkdir -p /tools/local-php-security-checker && \ |
| 151 | + cd /tools/local-php-security-checker && \ |
| 152 | + curl -L https://github.com/fabpot/local-php-security-checker/releases/download/v1.0.0/local-php-security-checker_1.0.0_linux_amd64 -o local-php-security-checker && \ |
| 153 | + chmod +x local-php-security-checker && \ |
| 154 | + mv local-php-security-checker /usr/local/bin/local-php-security-checker |
| 155 | + |
| 156 | +# Unset COMPOSER_BIN_DIR |
| 157 | +ENV COMPOSER_BIN_DIR="vendor/bin" |
| 158 | + |
| 159 | +# Unset the entry point |
| 160 | +ENTRYPOINT [] |
0 commit comments