-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (52 loc) · 1.9 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
ARG PHP_VERSION=7.3
FROM php:${PHP_VERSION}-cli
LABEL maintainer="Julien Langlois"
ENV HOME /tmp
########################
# Install common tools
########################
RUN apt-get update -y \
&& apt-get install -y \
software-properties-common \
build-essential \
apt-utils \
wget \
curl \
git \
ssh \
openssh-client \
bash \
unzip \
libzip-dev \
zlib1g-dev \
libpng-dev \
&& rm -rf /var/lib/apt/lists/*
########################
# Install Composer
########################
ARG COMPOSER_VERSION=1.8.6
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV PATH "$PATH:/tmp/vendor/bin"
RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" && echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
RUN docker-php-ext-install zip
RUN docker-php-ext-install gd
RUN set -ex \
&& curl -s -f -L -o /tmp/installer.php https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer \
&& php -r " \
if (!hash_file('SHA384', '/tmp/installer.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { \
unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit(1); \
}" \
&& php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \
&& composer --ansi --version --no-interaction \
&& rm -rf /tmp/* /tmp/.htaccess
########################
# Install PHPCS, PHPMD and PHPUnit
########################
ARG PHPUNIT_VERSION=^7.0
ARG PHPCS_VERSION=^3.4
ARG PHPMD_VERSION=^2.6
RUN composer global require phpunit/phpunit ${PHPUNIT_VERSION} && composer global require squizlabs/php_codesniffer ${PHPCS_VERSION} && composer global require phpmd/phpmd ${PHPMD_VERSION}
ENTRYPOINT ["/usr/bin/env"]