-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
101 lines (92 loc) · 2.74 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
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
FROM ubuntu:22.04
ARG icuVersion
ARG phpVersion
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]
# Configure the system for building ICU and PHP.
RUN apt-get update \
&& ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \
&& apt-get install -y \
autoconf \
automake \
bison \
ca-certificates \
clang \
cmake \
curl \
g++ \
gcc \
gdb \
libc6-dev \
libcurl4-openssl-dev \
libonig-dev \
libpcre2-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libzip-dev \
locales \
make \
pkg-config \
re2c \
shtool \
tzdata \
vim \
zip \
zlib1g-dev \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& locale-gen en_US.UTF-8
# Install ICU
RUN export icuDash="${icuVersion//./-}" \
&& export icuUnder="${icuVersion//./_}" \
&& cd /tmp \
&& curl -LOs "https://github.com/unicode-org/icu/releases/download/release-${icuDash}/icu4c-${icuUnder}-src.tgz" \
&& tar -zxf "icu4c-${icuUnder}-src.tgz" \
&& cd icu/source/ \
&& ./runConfigureICU Linux \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
&& cd /tmp \
&& rm -rf /tmp/icu "/tmp/icu4c-${icuUnder}-src.tgz"
# Install PHP
RUN cd /tmp \
&& curl -LOs "https://www.php.net/distributions/php-${phpVersion}.tar.xz" \
&& tar -Jxf "php-${phpVersion}.tar.xz" \
&& cd "php-${phpVersion}/" \
&& ./configure \
--enable-debug \
--enable-intl \
--enable-mbstring \
--enable-opcache \
--enable-opcache-jit \
--enable-zts \
--with-config-file-scan-dir=/usr/local/etc/php.conf.d \
--with-curl \
--with-layout=GNU \
--with-openssl \
--with-zip \
--with-zlib \
&& make -j$(nproc) \
&& make install \
&& mkdir -p "$(php-config --extension-dir)" \
&& mkdir -p "$(php-config --ini-dir)" \
&& cp php.ini-development "$(php-config --ini-path)/php.ini" \
&& cd /tmp \
&& rm -rf "/tmp/php-${phpVersion}" "/tmp/php-${phpVersion}.tar.xz"
# Force creation of a symlink to ecma_intl.so in the PHP extension directory,
# even though it does not yet exist. We will build the extension in /ext/modules,
# and we want PHP to be able to find it when we run tests.
RUN mkdir /ext \
&& ln -fs /ext/modules/ecma_intl.so "$(php-config --extension-dir)/ecma_intl.so"
# Add additional tools
COPY composer-install.sh /usr/bin
RUN apt-get update \
&& apt-get install -y \
git \
libcriterion-dev \
valgrind \
&& /usr/bin/composer-install.sh \
&& mv composer.phar /usr/bin/composer \
&& rm /usr/bin/composer-install.sh
WORKDIR /ext