-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathDockerfile-Wheezy
128 lines (113 loc) · 3.1 KB
/
Dockerfile-Wheezy
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
#
# PHP Farm Docker image
#
# we use Debian as the host OS
FROM philcryer/min-wheezy:latest
LABEL author="Andreas Gohr <[email protected]>, Eugene Sia <[email protected]>"
ENV \
# Packages needed for running various build scripts.
SCRIPT_PKGS=" \
debian-keyring \
wget \
" \
# Packages only needed for PHP build.
BUILD_PKGS=" \
autoconf \
build-essential \
# Flex needed for PHP 5.1 & 5.2 see http://php.net/manual/en/install.unix.php
flex \
lemon \
pkg-config \
" \
# PHP runtime dependencies.
RUNTIME_PKGS=" \
# Needed for PHP and Git to connect with SSL sites.
ca-certificates \
curl \
# apt-get complains that this is an 'essential' package.
debian-archive-keyring \
imagemagick \
libbz2-dev \
libc-client2007e-dev \
libcurl4-openssl-dev \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libldap2-dev \
libltdl-dev \
libmcrypt-dev \
libmhash-dev \
libmysqlclient-dev \
libpng-dev \
libpq-dev \
libsasl2-dev \
libssl-dev \
libsslcommon2-dev \
libt1-dev \
libwebp-dev \
libxml2-dev \
libxpm-dev \
libxslt1-dev \
" \
# Packages needed to run Apache httpd.
APACHE_PKGS="\
apache2 \
apache2-mpm-prefork \
# Fcgid mod for Apache - not a build dependency library.
libapache2-mod-fcgid \
"
# Install Apache and packages we need for runtime usage.
RUN apt-get update && \
apt-get install -y --no-install-recommends \
$RUNTIME_PKGS \
$APACHE_PKGS && \
\
# Clean up apt package lists.
rm -rf /var/lib/apt/lists/*
# Reconfigure Apache
RUN rm -rf /var/www/*
# Import our Apache configs.
COPY var-www /var/www/
COPY apache /etc/apache2/
# Import our own modifications for the PhpFarm script.
COPY phpfarm /phpfarm_mod
# The PHP versions to compile.
ENV PHP_FARM_VERSIONS="5.1.6 5.2.17 5.3.29 5.4.45 5.5.38 5.6.32 7.0.28 7.1.15 7.2.3" \
\
# Flags for C Compiler Loader: make php 5.3 work again.
LDFLAGS="-lssl -lcrypto -lstdc++" \
\
# Add path to built PHP executables, for module building and for Apache.
PATH="/phpfarm/inst/bin/:$PATH"
# Install packages needed for build.
RUN apt-get update && \
apt-get install -y --no-install-recommends $SCRIPT_PKGS $BUILD_PKGS && \
\
# Download PhpFarm scripts into /phpfarm/.
wget -O /phpfarm.tar.gz https://github.com/fpoirotte/phpfarm/archive/v0.2.0.tar.gz && \
mkdir /phpfarm && \
tar -xf /phpfarm.tar.gz -C /phpfarm --strip 1 && \
#
# Overwrite PhpFarm with our own modifications.
rm -rf /phpfarm/src/bzips /phpfarm/src/custom && \
mv /phpfarm_mod/* /phpfarm/src/ && \
#
# Wait for docker.sh to finish moving else trying to exec a file being
# written will output "Text file busy" error.
sleep 5s && \
rmdir /phpfarm_mod && \
#
# Build all PHP versions.
cd /phpfarm/src && \
./docker.sh && \
#
# Clean up.
apt-get purge -y $SCRIPT_PKGS $BUILD_PKGS && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# expose the ports
EXPOSE 8000 8051 8052 8053 8054 8055 8056 8070 8071 8072
# run it
WORKDIR /var/www
COPY run.sh /run.sh
CMD ["/bin/bash", "/run.sh"]