Skip to content

Commit ee6f3ee

Browse files
authored
Merge pull request #2 from devilbox/release-0.2
Multi build
2 parents 754e1f7 + 0ae98bb commit ee6f3ee

20 files changed

+666
-156
lines changed

.github/workflows/action_branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# (2/2) Build
2323
docker:
2424
needs: [params]
25-
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
25+
uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master
2626
with:
2727
enabled: true
2828
can_deploy: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release-') }}

.github/workflows/action_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# (2/2) Build
2525
docker:
2626
needs: [params]
27-
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
27+
uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master
2828
with:
2929
enabled: true
3030
can_deploy: false

.github/workflows/action_schedule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# (2/2) Build
2525
docker:
2626
needs: [params]
27-
uses: devilbox/github-actions/.github/workflows/docker-name-version-arch.yml@master
27+
uses: devilbox/github-actions/.github/workflows/docker-name-version-flavour-arch.yml@master
2828
with:
2929
enabled: true
3030
can_deploy: true

.github/workflows/params.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
{
1616
"NAME": "PHP",
1717
"VERSION": ["5.4"],
18+
"FLAVOUR": ["jessie", "stretch", "latest"],
1819
"ARCH": ["linux/amd64", "linux/386", "linux/arm64", "linux/arm/v7", "linux/arm/v6"]
1920
}
2021
]

Dockerfile

Lines changed: 0 additions & 150 deletions
This file was deleted.

Dockerfiles/Dockerfile.jessie

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
FROM debian:jessie-slim
2+
MAINTAINER "cytopia" <[email protected]>
3+
4+
5+
ENV PHP_VERSION=5.4.45
6+
ENV PHP_INI_DIR=/usr/local/etc/php
7+
8+
ENV OPENSSL_VERSION=1.0.1t
9+
10+
ENV PHP_BUILD_DEPS \
11+
autoconf2.13 \
12+
libbison-dev \
13+
libcurl4-openssl-dev \
14+
libfl-dev \
15+
libmysqlclient-dev \
16+
libpcre3-dev \
17+
libreadline6-dev \
18+
librecode-dev \
19+
libsqlite3-dev \
20+
libssl-dev \
21+
libxml2-dev
22+
23+
ENV PHP_RUNTIME_DEPS \
24+
libmysqlclient18 \
25+
libpcre3 \
26+
librecode0 \
27+
libsqlite3-0 \
28+
libssl1.0.0 \
29+
libxml2 \
30+
xz-utils
31+
32+
ENV BUILD_TOOLS \
33+
autoconf \
34+
ca-certificates \
35+
curl \
36+
dpkg-dev \
37+
file \
38+
flex \
39+
g++ \
40+
gcc \
41+
libc-dev \
42+
make \
43+
patch \
44+
pkg-config \
45+
re2c \
46+
xz-utils
47+
48+
ENV BUILD_TOOLS_32 \
49+
g++-multilib \
50+
gcc-multilib
51+
52+
ENV RUNTIME_TOOLS \
53+
ca-certificates \
54+
curl
55+
56+
57+
###
58+
### Build OpenSSL
59+
###
60+
RUN set -eux \
61+
# Install Dependencies
62+
&& apt-get update \
63+
&& apt-get install -y --no-install-recommends --no-install-suggests \
64+
${BUILD_TOOLS} \
65+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
66+
apt-get install -y --no-install-recommends --no-install-suggests \
67+
${BUILD_TOOLS_32}; \
68+
fi \
69+
# Fetch OpenSSL
70+
&& cd /tmp \
71+
&& mkdir openssl \
72+
&& update-ca-certificates \
73+
&& curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \
74+
&& curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \
75+
&& tar -xzf openssl.tar.gz -C openssl --strip-components=1 \
76+
&& cd /tmp/openssl \
77+
# Build OpenSSL
78+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
79+
setarch i386 ./config -m32; \
80+
else \
81+
./config; \
82+
fi \
83+
&& make depend \
84+
&& make -j"$(nproc)" \
85+
&& make install \
86+
# Cleanup
87+
&& rm -rf /tmp/* \
88+
# Ensure libs are linked to correct architecture directory
89+
&& debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \
90+
&& mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \
91+
&& ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \
92+
# Remove Dependencies
93+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
94+
${BUILD_TOOLS} \
95+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
96+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
97+
${BUILD_TOOLS_32}; \
98+
fi \
99+
&& apt-get clean \
100+
&& rm -rf /var/lib/apt/lists/*
101+
102+
103+
###
104+
### Setup PHP directories
105+
###
106+
RUN set -eux \
107+
&& mkdir -p ${PHP_INI_DIR}/conf.d \
108+
&& mkdir -p /usr/src/php
109+
110+
111+
###
112+
### Copy PHP, scripts and patches
113+
###
114+
COPY data/docker-php-source /usr/local/bin/
115+
COPY data/php/php-${PHP_VERSION}.tar.xz /usr/src/php.tar.xz
116+
COPY data/php/config.guess.patched /usr/src/config.guess
117+
118+
119+
###
120+
### Build PHP
121+
###
122+
RUN set -eux \
123+
# Install Dependencies
124+
&& apt-get update \
125+
&& apt-get install -y --no-install-recommends --no-install-suggests \
126+
${PHP_BUILD_DEPS} \
127+
${BUILD_TOOLS} \
128+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
129+
apt-get install -y --no-install-recommends --no-install-suggests \
130+
${BUILD_TOOLS_32}; \
131+
fi \
132+
# Extract PHP
133+
&& tar -Jxf /usr/src/php.tar.xz -C "/usr/src/php" --strip-components=1 \
134+
# Patch config.guess
135+
&& mv -f /usr/src/config.guess /usr/src/php/config.guess \
136+
# Remove old tar.xz
137+
&& rm /usr/src/php.tar.xz \
138+
# Create php.tar.xz
139+
&& cd /usr/src \
140+
&& tar -cJf php.tar.xz php \
141+
# Setup Requirements
142+
&& docker-php-source extract \
143+
&& cd /usr/src/php \
144+
\
145+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
146+
&& debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \
147+
\
148+
# https://bugs.php.net/bug.php?id=74125
149+
&& if [ ! -d /usr/include/curl ]; then \
150+
ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \
151+
fi \
152+
# Build PHP
153+
&& ./configure \
154+
--with-libdir="/lib/${debMultiarch}/" \
155+
--with-config-file-path="${PHP_INI_DIR}" \
156+
--with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \
157+
--enable-fpm \
158+
--with-fpm-user=www-data \
159+
--with-fpm-group=www-data \
160+
--disable-cgi \
161+
--enable-mysqlnd \
162+
--with-mysql \
163+
--with-curl \
164+
--with-openssl=/usr/local/ssl \
165+
--with-readline \
166+
--with-recode \
167+
--with-zlib \
168+
&& make -j"$(nproc)" \
169+
&& make install \
170+
# Cleanup
171+
&& make clean \
172+
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
173+
&& docker-php-source delete \
174+
# Remove Dependencies
175+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
176+
${PHP_BUILD_DEPS} \
177+
${BUILD_TOOLS} \
178+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
179+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
180+
${BUILD_TOOLS_32}; \
181+
fi \
182+
# Install Run-time requirements
183+
&& apt-get update \
184+
&& apt-get install -y --no-install-recommends --no-install-suggests \
185+
${PHP_RUNTIME_DEPS} \
186+
${RUNTIME_TOOLS} \
187+
&& apt-get clean \
188+
&& rm -rf /var/lib/apt/lists/*
189+
190+
191+
COPY data/docker-php-* /usr/local/bin/
192+
193+
WORKDIR /var/www/html
194+
COPY data/php-fpm.conf /usr/local/etc/
195+
COPY data/php.ini /usr/local/etc/php/php.ini
196+
197+
EXPOSE 9000
198+
CMD ["php-fpm"]

0 commit comments

Comments
 (0)