-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathDockerfile
More file actions
175 lines (148 loc) · 5.95 KB
/
Copy pathDockerfile
File metadata and controls
175 lines (148 loc) · 5.95 KB
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
FROM php:8.5.2-fpm-bookworm
ARG TIME_ZONE=Pacific/Auckland
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
apt-transport-https \
libfreetype6-dev \
libjpeg62-turbo-dev \
libwebp-dev \
libmcrypt-dev \
libpng-dev \
libxml2-dev \
libicu-dev \
libpq-dev \
gnupg2 \
cron \
nano \
vim \
wget \
openssl \
locales \
tzdata \
git \
libzip-dev \
libmemcached-dev \
zip \
netcat-traditional \
bc \
ghostscript \
graphviz \
aspell \
clamdscan \
libldap2-dev \
libltdl-dev \
libc-client-dev \
libkrb5-dev \
libssl-dev \
libpspell-dev \
xmlstarlet \
libtool \
bison
COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie
RUN docker-php-ext-install -j$(nproc) \
zip \
intl \
soap \
pdo_pgsql \
pdo_mysql \
pgsql \
mysqli \
exif \
ldap \
pcntl \
&& docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
&& docker-php-ext-install -j$(nproc) gd
RUN git clone https://github.com/longxinH/xhprof.git ./xhprof \
&& cd xhprof \
&& git checkout v2.3.10 \
&& cd extension/ \
&& phpize \
&& ./configure \
&& make && make install
RUN echo "extension=xhprof.so" >> /usr/local/etc/php/conf.d/xhprof.ini \
&& echo "xhprof.output_dir = /tmp/xhprof" >> /usr/local/etc/php/conf.d/xhprof.ini
RUN pecl channel-update pecl.php.net && \
pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis
RUN pecl channel-update pecl.php.net && \
pecl install -o -f igbinary \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable igbinary
RUN pecl channel-update pecl.php.net && \
pecl install -o -f memcached \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable memcached
RUN pecl channel-update pecl.php.net && \
pecl install -o -f imap \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable imap
RUN pecl channel-update pecl.php.net && \
pecl install -o -f excimer \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable excimer
RUN pecl channel-update pecl.php.net && \
pecl install -o -f pspell \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable pspell
RUN pecl channel-update pecl.php.net && \
pecl install -o -f xdebug-3.5.1 \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable xdebug.so
RUN pecl channel-update pecl.php.net && \
pecl install -o -f pcov \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable pcov
# Install composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# we need en_US locales for MSSQL connection to work
# we need en_AU locales for behat to work
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_AU.UTF-8 UTF-8/en_AU.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
# install mssql extension
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update && ACCEPT_EULA=Y apt-get install -y \
msodbcsql18 \
mssql-tools18 \
unixodbc-dev
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile \
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
# TODO: uncomment when sqlsrv supports PHP 8.5 https://github.com/microsoft/msphpsql/releases
# Workaround applied: https://github.com/microsoft/msphpsql/issues/1438#issuecomment-1444773949
# RUN pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system \
# && pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 || \
# apt-get install -y --allow-downgrades odbcinst=2.3.7 odbcinst1debian2=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 && \
# pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0
# RUN docker-php-ext-enable sqlsrv.so && docker-php-ext-enable pdo_sqlsrv.so
RUN ln -fs /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata
COPY config/php.ini /usr/local/etc/php/
COPY config/fpm.conf /usr/local/etc/php-fpm.d/zz-totara.conf
COPY config/clamd.conf /etc/clamav/clamd.conf
# Source each .sh file found in the /shell/ folder, always source the default_aliases.sh file first
RUN echo 'if [[ -e "/root/custom_shell/default-aliases.sh" ]]; then source "/root/custom_shell/default-aliases.sh"; fi' >> ~/.bashrc && \
echo 'for f in /root/custom_shell/*.sh; do [[ "$f" != "/root/custom_shell/default-aliases.sh" && -e "$f" ]] && source "$f"; done;' >> ~/.bashrc
# Have the option of using the oh my zsh shell.
RUN apt-get update && apt-get install -y zsh
RUN sh -c "$(curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
RUN git clone https://github.com/romkatv/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
RUN git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]