Skip to content

Commit f18758e

Browse files
authored
Merge pull request #3 from devilbox/release-0.3
Fix OpenSSL and have multi host builds
2 parents 37e8596 + 4ed913d commit f18758e

19 files changed

Lines changed: 805 additions & 151 deletions

.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.5"],
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 & 144 deletions
This file was deleted.

Dockerfiles/Dockerfile.jessie

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
FROM debian:jessie-slim
2+
MAINTAINER "cytopia" <cytopia@everythingcli.org>
3+
4+
5+
ENV PHP_VERSION=5.5.38
6+
ENV PHP_INI_DIR=/usr/local/etc/php
7+
8+
# As this is the Jessie Version already, we can skip custom OpenSSL installation
9+
10+
# PHP 5.5 does not work with OpenSSL version from Debian Stretch (need to pick it from Jessie)
11+
# https://github.com/devilbox/docker-php-fpm-5.3/issues/7
12+
#
13+
# https://manpages.debian.org/jessie/openssl/openssl.1ssl.en.html
14+
# https://www.openssl.org/source/old/1.0.1/
15+
#ENV OPENSSL_VERSION=1.0.1t
16+
17+
ENV PHP_BUILD_DEPS \
18+
autoconf2.13 \
19+
libbison-dev \
20+
libcurl4-openssl-dev \
21+
libfl-dev \
22+
libmysqlclient-dev \
23+
libpcre3-dev \
24+
libreadline6-dev \
25+
librecode-dev \
26+
libsqlite3-dev \
27+
# libssl-dev/oldoldstable 1.0.1t-1
28+
libssl-dev \
29+
libxml2-dev
30+
31+
ENV PHP_RUNTIME_DEPS \
32+
libmysqlclient18 \
33+
libpcre3 \
34+
librecode0 \
35+
libsqlite3-0 \
36+
# libssl1.0.0/oldoldstable,now 1.0.1t-1
37+
libssl1.0.0 \
38+
libxml2 \
39+
xz-utils
40+
41+
ENV BUILD_TOOLS \
42+
autoconf \
43+
bison \
44+
bisonc++ \
45+
ca-certificates \
46+
curl \
47+
dpkg-dev \
48+
file \
49+
flex \
50+
g++ \
51+
gcc \
52+
libc-dev \
53+
make \
54+
patch \
55+
pkg-config \
56+
re2c \
57+
xz-utils
58+
59+
ENV BUILD_TOOLS_32 \
60+
g++-multilib \
61+
gcc-multilib
62+
63+
ENV RUNTIME_TOOLS \
64+
ca-certificates \
65+
curl
66+
67+
68+
# As this is the Jessie Version already, we can skip custom OpenSSL installation
69+
70+
###
71+
### Build OpenSSL
72+
###
73+
#RUN set -eux \
74+
## Install Dependencies
75+
# && apt-get update \
76+
# && apt-get install -y --no-install-recommends --no-install-suggests \
77+
# ${BUILD_TOOLS} \
78+
# && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
79+
# apt-get install -y --no-install-recommends --no-install-suggests \
80+
# ${BUILD_TOOLS_32}; \
81+
# fi \
82+
## Fetch OpenSSL
83+
# && cd /tmp \
84+
# && mkdir openssl \
85+
# && update-ca-certificates \
86+
# && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \
87+
# && curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \
88+
# && tar -xzf openssl.tar.gz -C openssl --strip-components=1 \
89+
# && cd /tmp/openssl \
90+
## Build OpenSSL
91+
# && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
92+
# setarch i386 ./config -m32; \
93+
# else \
94+
# ./config; \
95+
# fi \
96+
# && make depend \
97+
# && make -j"$(nproc)" \
98+
# && make install \
99+
## Cleanup
100+
# && rm -rf /tmp/* \
101+
## Ensure libs are linked to correct architecture directory
102+
# && debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \
103+
# && mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \
104+
# && ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" \
105+
## Remove Dependencies
106+
# && if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
107+
# apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
108+
# ${BUILD_TOOLS_32}; \
109+
# fi \
110+
# && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
111+
# ${BUILD_TOOLS} \
112+
# && apt-get clean \
113+
# && rm -rf /var/lib/apt/lists/*
114+
115+
116+
###
117+
### Setup PHP directories
118+
###
119+
RUN set -eux \
120+
&& mkdir -p ${PHP_INI_DIR}/conf.d \
121+
&& mkdir -p /usr/src/php
122+
123+
124+
###
125+
### Copy PHP, scripts and patches
126+
###
127+
COPY data/docker-php-source /usr/local/bin/
128+
COPY data/php/php-${PHP_VERSION}.tar.xz /usr/src/php.tar.xz
129+
130+
131+
###
132+
### Build PHP
133+
###
134+
RUN set -eux \
135+
# Install Dependencies
136+
&& apt-get update \
137+
&& apt-get install -y --no-install-recommends --no-install-suggests \
138+
${PHP_BUILD_DEPS} \
139+
${BUILD_TOOLS} \
140+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
141+
apt-get install -y --no-install-recommends --no-install-suggests \
142+
${BUILD_TOOLS_32}; \
143+
fi \
144+
# Setup Requirements
145+
&& docker-php-source extract \
146+
&& cd /usr/src/php \
147+
\
148+
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
149+
&& debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \
150+
\
151+
# https://bugs.php.net/bug.php?id=74125
152+
&& if [ ! -d /usr/include/curl ]; then \
153+
ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \
154+
fi \
155+
# Build PHP
156+
&& ./configure \
157+
--with-libdir="/lib/${debMultiarch}/" \
158+
--with-config-file-path="${PHP_INI_DIR}" \
159+
--with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \
160+
--disable-cgi \
161+
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
162+
--enable-ftp \
163+
--with-openssl-dir=/usr \
164+
\
165+
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
166+
--enable-mbstring \
167+
\
168+
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
169+
--enable-mysqlnd \
170+
\
171+
--enable-fpm \
172+
--with-fpm-user=www-data \
173+
--with-fpm-group=www-data \
174+
# https://github.com/docker-library/php/issues/439
175+
--with-mhash \
176+
\
177+
# always build against system sqlite3 (https://github.com/php/php-src/commit/6083a387a81dbbd66d6316a3a12a63f06d5f7109)
178+
--with-pdo-sqlite=/usr \
179+
--with-sqlite3=/usr \
180+
\
181+
--with-curl \
182+
--with-openssl \
183+
--with-readline \
184+
--with-recode \
185+
--with-zlib \
186+
&& make -j"$(nproc)" \
187+
&& make install \
188+
# Cleanup
189+
&& make clean \
190+
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
191+
&& docker-php-source delete \
192+
# Remove Dependencies
193+
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \
194+
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
195+
${BUILD_TOOLS_32}; \
196+
fi \
197+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
198+
${PHP_BUILD_DEPS} \
199+
${BUILD_TOOLS} \
200+
# Install Run-time requirements
201+
&& apt-get update \
202+
&& apt-get install -y --no-install-recommends --no-install-suggests \
203+
${PHP_RUNTIME_DEPS} \
204+
${RUNTIME_TOOLS} \
205+
&& apt-get clean \
206+
&& rm -rf /var/lib/apt/lists/*
207+
208+
209+
COPY data/docker-php-* /usr/local/bin/
210+
211+
WORKDIR /var/www/html
212+
COPY data/php-fpm.conf /usr/local/etc/
213+
COPY data/php.ini /usr/local/etc/php/php.ini
214+
215+
EXPOSE 9000
216+
CMD ["php-fpm"]

0 commit comments

Comments
 (0)