-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
85 lines (71 loc) · 3.66 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
FROM debian:stretch-slim
RUN apt-get --assume-yes update
# Dependencies to download and unpack source (pigz and pbzip2 are parallel gz and bzip2)
RUN DEBIAN_FRONTEND=noninteractive apt-get --quiet --assume-yes install apt-utils curl pigz pbzip2 pkg-config
# Dependencies to build bare PHP
RUN DEBIAN_FRONTEND=noninteractive apt-get --quiet --assume-yes install build-essential autoconf automake libtool
# Dependencies for the specific configuration of PHP
RUN DEBIAN_FRONTEND=noninteractive apt-get --quiet --assume-yes install libxml2 libxml2-dev libssl-dev
WORKDIR /root
RUN curl --output openssl-1.0.2o.tar.gz https://www.openssl.org/source/openssl-1.0.2o.tar.gz
RUN echo "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d openssl-1.0.2o.tar.gz" | sha256sum --check -
RUN tar --use-compress-program=pigz --extract --file=openssl-1.0.2o.tar.gz
WORKDIR /root/openssl-1.0.2o
# make install_sw only installs software, we don't need man there
RUN ./config --prefix=/opt/openssl-1.0.2o && make -j$(nproc) && make install_sw
WORKDIR /root
RUN curl --output php-5.3.3.tar.bz2 https://museum.php.net/php5/php-5.3.3.tar.bz2
RUN echo "f2876750f3c54854a20e26a03ca229f2fbf89b8ee6176b9c0586cb9b2f0b3f9a php-5.3.3.tar.bz2" | sha256sum --check -
RUN tar --use-compress-program=pbzip2 --extract --file php-5.3.3.tar.bz2
RUN curl --output php53-libxml.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
RUN echo "c834246a33f7518bb76e292a658da955ca4a4103d2eb144e18124721f3d2b10b php53-libxml.patch" | sha256sum --check -
WORKDIR /root/php-5.3.3
# Workaround for building PHP 5.3 with modern libxml, taken from
# https://stackoverflow.com/questions/28211039/phpbrew-5-3-10-build-error-dereferencing-pointer-to-incomplete-type
RUN patch -p0 < /root/php53-libxml.patch
RUN ./configure --prefix=/opt/php-5.3.3 \
--disable-cgi \
--without-sqlite3 \
--without-pdo_sqlite \
--with-openssl=/opt/openssl-1.0.2o \
&& make -j$(nproc) \
&& make install
RUN /opt/php-5.3.3/bin/pecl install xdebug-2.2.7
RUN ln --symbolic /opt/php-5.3.3/bin/php /usr/local/bin/php533
WORKDIR /root
RUN curl --location --output php-7.2.7.tar.bz2 https://php.net/distributions/php-7.2.7.tar.bz2
RUN echo "cc81675a96af4dd18d8ffc02f26a36c622abadf86af7ecfea7bcde8d3c96d5a3 php-7.2.7.tar.bz2" | sha256sum --check -
RUN tar --use-compress-program=pbzip2 --extract --file=php-7.2.7.tar.bz2
WORKDIR /root/php-7.2.7
RUN ./configure --prefix=/opt/php-7.2.7 \
--disable-cgi \
--without-sqlite3 \
--without-pdo_sqlite \
--with-openssl \
--enable-mbstring \
&& make -j$(nproc) \
&& make install
RUN /opt/php-7.2.7/bin/pecl install xdebug
RUN ln --symbolic /opt/php-7.2.7/bin/php /usr/local/bin/php727
WORKDIR /root
RUN DEBIAN_FRONTEND=noninteractive apt-get --quiet --assume-yes install libonig-dev
RUN curl --location --output php-8.0.0.tar.bz2 https://php.net/distributions/php-8.0.0.tar.bz2 && \
echo "5e832dc37eabf444410b4ea6fb3d66b72e44e7407a3b49caa5746edcf71b9d09 php-8.0.0.tar.bz2" | sha256sum --check -
RUN tar --use-compress-program=pbzip2 --extract --file=php-8.0.0.tar.bz2
WORKDIR /root/php-8.0.0
RUN ./configure --prefix=/opt/php-8.0.0 \
--disable-cgi \
--without-sqlite3 \
--without-pdo_sqlite \
--with-openssl \
--with-pear \
--enable-mbstring \
&& make -j$(nproc) \
&& make install
RUN /opt/php-8.0.0/bin/pecl install xdebug
RUN ln --symbolic /opt/php-8.0.0/bin/php /usr/local/bin/php800
# To make composer work with --prefer-dist work (requires unzip program or zip ext)
RUN DEBIAN_FRONTEND=noninteractive apt-get install --quiet --assume-yes unzip
RUN useradd --uid 1000 --create-home --home-dir /opt/project project
USER project
WORKDIR /opt/project