forked from mcustiel/docker-php-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_base
204 lines (173 loc) · 6.37 KB
/
Dockerfile_base
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# This file is part of mcustiel/docker-php-tools.
#
# docker-php-tools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# docker-php-tools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with mcustiel/docker-php-tools. If not, see <http://www.gnu.org/licenses/>.
ARG PHP_DOCKER_IMAGE_TAG=latest
FROM php:$PHP_DOCKER_IMAGE_TAG
MAINTAINER Mariano Custiel <[email protected]>
# phars directory
ENV PHARS_DIR /opt/phars
RUN mkdir -p $PHARS_DIR
ENV PATH $PHARS_DIR:$PATH
RUN apt-get update && \
apt-get install --yes --no-install-recommends \
libssh2-1-dev \
gzip \
zip \
git \
zlib1g-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libbz2-dev \
libxslt-dev \
libldap2-dev \
curl \
git \
subversion \
unzip \
openssh-client \
wget \
imagemagick \
libgraphicsmagick1-dev \
libmagickwand-dev \
libcurl4-gnutls-dev \
libssl-dev \
libenchant-dev \
libgmp-dev \
libc-client-dev \
libkrb5-dev \
libpspell-dev \
libaspell-dev \
aspell-en \
aspell-de \
aspell-es \
libxml2-dev \
libtidy-dev \
librecode-dev \
libsnmp-dev \
libreadline-dev \
libedit-dev \
snmp \
libzip-dev \
&& rm -r /var/lib/apt/lists/*
RUN pecl install redis-4.1.1 && docker-php-ext-enable redis
RUN pecl install imagick-3.4.3 && docker-php-ext-enable imagick
RUN docker-php-ext-install bcmath
RUN docker-php-ext-install bz2
RUN docker-php-ext-install calendar
RUN docker-php-ext-install ctype
RUN docker-php-ext-install curl
RUN docker-php-ext-install dba
RUN docker-php-ext-install dom
RUN docker-php-ext-install enchant
RUN docker-php-ext-install exif
RUN docker-php-ext-install fileinfo
#RUN docker-php-ext-install filter
RUN docker-php-ext-install ftp
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install gd
RUN docker-php-ext-install gettext
RUN docker-php-ext-install hash
RUN docker-php-ext-install iconv
RUN docker-php-ext-install intl
RUN docker-php-ext-install json
# RUN docker-php-ext-install interbase
RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && docker-php-ext-install ldap
RUN docker-php-ext-install mbstring
#RUN docker-php-ext-install mssql
RUN docker-php-ext-install mysqli
#RUN docker-php-ext-install oci8
#RUN docker-php-ext-install odbc
RUN docker-php-ext-install opcache
RUN docker-php-ext-install pcntl
RUN docker-php-ext-install pdo
#RUN docker-php-ext-install pdo_dblib
#RUN docker-php-ext-install pdo_firebird
RUN docker-php-ext-install pdo_mysql
#RUN docker-php-ext-install pdo_oci
#RUN docker-php-ext-install pdo_odbc
#RUN docker-php-ext-install pdo_pgsql
#RUN docker-php-ext-install pdo_sqlite
#RUN docker-php-ext-install pgsql
#RUN docker-php-ext-install phar
RUN docker-php-ext-install posix
RUN docker-php-ext-install pspell
RUN docker-php-ext-install readline
RUN docker-php-ext-install recode
#RUN docker-php-ext-install reflection
RUN docker-php-ext-install session
RUN docker-php-ext-install shmop
RUN docker-php-ext-install simplexml
RUN docker-php-ext-install snmp
RUN docker-php-ext-install soap
RUN docker-php-ext-install sockets
#RUN docker-php-ext-install spl
#RUN docker-php-ext-install standard
RUN docker-php-ext-install sysvmsg
RUN docker-php-ext-install sysvsem
RUN docker-php-ext-install sysvshm
RUN docker-php-ext-install tidy
RUN docker-php-ext-install tokenizer
RUN docker-php-ext-install wddx
RUN docker-php-ext-install xml
RUN docker-php-ext-install xmlrpc
RUN docker-php-ext-install xmlwriter
RUN docker-php-ext-install xsl
RUN docker-php-ext-install zip
# PHP Configuration
COPY ./config/phar-writable.ini /usr/local/etc/php/conf.d
# Register the COMPOSER_HOME environment variable
ENV COMPOSER_HOME /composer
# Add global binary directory to PATH and make sure to re-export it
ENV PATH /composer/vendor/bin:$PATH
# Allow Composer to be run as root
ENV COMPOSER_ALLOW_SUPERUSER 1
# Setup composer
RUN EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" && \
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] ; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
RESULT=$? && \
rm composer-setup.php
# Parallel downloads for composer
RUN composer global require hirak/prestissimo
# PHP tools
RUN composer global require phing/phing
RUN composer global require phploc/phploc
RUN composer global require phpmd/phpmd
RUN composer global require squizlabs/php_codesniffer
RUN composer global require pear/archive_tar
RUN composer global require friendsofphp/php-cs-fixer
RUN composer global require codeception/codeception
RUN composer global require sensiolabs/security-checker
RUN composer global require phpmetrics/phpmetrics
RUN curl -L http://phpdoc.org/phpDocumentor.phar -o $PHARS_DIR/phpDocumentor
RUN chmod +x $PHARS_DIR/phpDocumentor
# Box
RUN echo "phar.readonly=off" > $PHP_INI_DIR/conf.d/phar.ini
RUN curl -LSs https://box-project.github.io/box2/installer.php | php
RUN chmod 0755 box.phar && mv box.phar /composer/vendor/bin/box
# CS config for SF2 standards
RUN composer global require escapestudios/symfony2-coding-standard
RUN phpcs --config-set installed_paths $COMPOSER_HOME/vendor/escapestudios/symfony2-coding-standard
# Memory Limit
RUN echo "memory_limit=-1" > $PHP_INI_DIR/conf.d/memory-limit.ini
# Time Zone
RUN echo "date.timezone=${PHP_TIMEZONE:-UTC}" > $PHP_INI_DIR/conf.d/date_timezone.ini
# Phars
VOLUME ["/app"]
WORKDIR /app
# Set up the command arguments
CMD ["-"]
ENTRYPOINT []