Skip to content

Commit fdf990f

Browse files
committed
feat: add PHP 8.4 support with OCI8 extension
- Add 4 new Docker image variants for PHP 8.4: * 8.4-oci8-nginx * 8.4-oci8-nginx-prod * 8.4-oci8-swoole-nginx * 8.4-oci8-swoole-nginx-prod - Update template to use PECL for PHP >= 8.4 * OCI8 extension no longer available in PHP core for 8.4+ * Install via PECL with automatic cleanup of build dependencies * Maintain backward compatibility with older versions using docker-php-ext - Update fwd-template.json with PHP 8.4 build configurations - Update kool.yml with PHP 8.4 build commands - Update README.md with PHP 8.4 documentation and links All images tested and verified with OCI8 3.4.1 and Oracle Client 11.2.0.4.0
1 parent ac68b7b commit fdf990f

8 files changed

Lines changed: 173 additions & 0 deletions

File tree

8.4-oci8-nginx-prod/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM kooldev/php:8.4-nginx-prod
2+
3+
ENV LD_LIBRARY_PATH /usr/local/instantclient
4+
ENV ORACLE_HOME /usr/local/instantclient
5+
6+
# Download and unarchive Instant Client v11
7+
RUN apk add --update libaio libnsl $PHPIZE_DEPS && \
8+
curl -o /tmp/instaclient-basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \
9+
curl -o /tmp/instaclient-sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \
10+
curl -o /tmp/instaclient-sqlplus.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip && \
11+
unzip -d /usr/local/ /tmp/instaclient-basic.zip && \
12+
unzip -d /usr/local/ /tmp/instaclient-sdk.zip && \
13+
unzip -d /usr/local/ /tmp/instaclient-sqlplus.zip && \
14+
ln -s /usr/local/instantclient_11_2 ${ORACLE_HOME} && \
15+
ln -s ${ORACLE_HOME}/libclntsh.so.* ${ORACLE_HOME}/libclntsh.so && \
16+
ln -s ${ORACLE_HOME}/libocci.so.* ${ORACLE_HOME}/libocci.so && \
17+
ln -s ${ORACLE_HOME}/lib* /usr/lib && \
18+
ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus && \
19+
ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \
20+
echo "instantclient,${ORACLE_HOME}" | pecl install oci8 && \
21+
docker-php-ext-enable oci8 && \
22+
apk del $PHPIZE_DEPS

8.4-oci8-nginx/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM kooldev/php:8.4-nginx
2+
3+
ENV LD_LIBRARY_PATH /usr/local/instantclient
4+
ENV ORACLE_HOME /usr/local/instantclient
5+
6+
# Download and unarchive Instant Client v11
7+
RUN apk add --update libaio libnsl $PHPIZE_DEPS && \
8+
curl -o /tmp/instaclient-basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \
9+
curl -o /tmp/instaclient-sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \
10+
curl -o /tmp/instaclient-sqlplus.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip && \
11+
unzip -d /usr/local/ /tmp/instaclient-basic.zip && \
12+
unzip -d /usr/local/ /tmp/instaclient-sdk.zip && \
13+
unzip -d /usr/local/ /tmp/instaclient-sqlplus.zip && \
14+
ln -s /usr/local/instantclient_11_2 ${ORACLE_HOME} && \
15+
ln -s ${ORACLE_HOME}/libclntsh.so.* ${ORACLE_HOME}/libclntsh.so && \
16+
ln -s ${ORACLE_HOME}/libocci.so.* ${ORACLE_HOME}/libocci.so && \
17+
ln -s ${ORACLE_HOME}/lib* /usr/lib && \
18+
ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus && \
19+
ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \
20+
echo "instantclient,${ORACLE_HOME}" | pecl install oci8 && \
21+
docker-php-ext-enable oci8 && \
22+
apk del $PHPIZE_DEPS
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM kooldev/php:8.4-swoole-nginx-prod
2+
3+
ENV LD_LIBRARY_PATH /usr/local/instantclient
4+
ENV ORACLE_HOME /usr/local/instantclient
5+
6+
# Download and unarchive Instant Client v11
7+
RUN apk add --update libaio libnsl $PHPIZE_DEPS && \
8+
curl -o /tmp/instaclient-basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \
9+
curl -o /tmp/instaclient-sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \
10+
curl -o /tmp/instaclient-sqlplus.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip && \
11+
unzip -d /usr/local/ /tmp/instaclient-basic.zip && \
12+
unzip -d /usr/local/ /tmp/instaclient-sdk.zip && \
13+
unzip -d /usr/local/ /tmp/instaclient-sqlplus.zip && \
14+
ln -s /usr/local/instantclient_11_2 ${ORACLE_HOME} && \
15+
ln -s ${ORACLE_HOME}/libclntsh.so.* ${ORACLE_HOME}/libclntsh.so && \
16+
ln -s ${ORACLE_HOME}/libocci.so.* ${ORACLE_HOME}/libocci.so && \
17+
ln -s ${ORACLE_HOME}/lib* /usr/lib && \
18+
ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus && \
19+
ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \
20+
echo "instantclient,${ORACLE_HOME}" | pecl install oci8 && \
21+
docker-php-ext-enable oci8 && \
22+
apk del $PHPIZE_DEPS

8.4-oci8-swoole-nginx/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM kooldev/php:8.4-swoole-nginx
2+
3+
ENV LD_LIBRARY_PATH /usr/local/instantclient
4+
ENV ORACLE_HOME /usr/local/instantclient
5+
6+
# Download and unarchive Instant Client v11
7+
RUN apk add --update libaio libnsl $PHPIZE_DEPS && \
8+
curl -o /tmp/instaclient-basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \
9+
curl -o /tmp/instaclient-sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \
10+
curl -o /tmp/instaclient-sqlplus.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip && \
11+
unzip -d /usr/local/ /tmp/instaclient-basic.zip && \
12+
unzip -d /usr/local/ /tmp/instaclient-sdk.zip && \
13+
unzip -d /usr/local/ /tmp/instaclient-sqlplus.zip && \
14+
ln -s /usr/local/instantclient_11_2 ${ORACLE_HOME} && \
15+
ln -s ${ORACLE_HOME}/libclntsh.so.* ${ORACLE_HOME}/libclntsh.so && \
16+
ln -s ${ORACLE_HOME}/libocci.so.* ${ORACLE_HOME}/libocci.so && \
17+
ln -s ${ORACLE_HOME}/lib* /usr/lib && \
18+
ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus && \
19+
ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \
20+
echo "instantclient,${ORACLE_HOME}" | pecl install oci8 && \
21+
docker-php-ext-enable oci8 && \
22+
apk del $PHPIZE_DEPS

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ This image is based on [kooldev/php](https://github.com/kool-dev/docker-php), pl
66

77
## Available Tags
88

9+
### 8.4
10+
11+
- [8.4-oci8-nginx](https://github.com/kool-dev/docker-php-oci8/blob/main/8.4-oci8-nginx/Dockerfile)
12+
- [8.4-oci8-nginx-prod](https://github.com/kool-dev/docker-php-oci8/blob/main/8.4-oci8-nginx-prod/Dockerfile)
13+
14+
### 8.4 with Swoole
15+
16+
- [8.4-oci8-swoole-nginx](https://github.com/kool-dev/docker-php-oci8/blob/main/8.4-oci8-swoole-nginx/Dockerfile)
17+
- [8.4-oci8-swoole-nginx-prod](https://github.com/kool-dev/docker-php-oci8/blob/main/8.4-oci8-swoole-nginx-prod/Dockerfile)
18+
919
### 8.3
1020

1121
- [8.3-oci8-nginx](https://github.com/kool-dev/docker-php-oci8/blob/main/8.3-oci8-nginx/Dockerfile)

fwd-template.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,54 @@
192192
"path": "template/Dockerfile"
193193
}
194194
]
195+
},
196+
{
197+
"name": "8.4-oci8-nginx-prod",
198+
"data": {
199+
"from": "kooldev/php:8.4-nginx-prod"
200+
},
201+
"files": [
202+
{
203+
"name": "Dockerfile",
204+
"path": "template/Dockerfile"
205+
}
206+
]
207+
},
208+
{
209+
"name": "8.4-oci8-nginx",
210+
"data": {
211+
"from": "kooldev/php:8.4-nginx"
212+
},
213+
"files": [
214+
{
215+
"name": "Dockerfile",
216+
"path": "template/Dockerfile"
217+
}
218+
]
219+
},
220+
{
221+
"name": "8.4-oci8-swoole-nginx-prod",
222+
"data": {
223+
"from": "kooldev/php:8.4-swoole-nginx-prod"
224+
},
225+
"files": [
226+
{
227+
"name": "Dockerfile",
228+
"path": "template/Dockerfile"
229+
}
230+
]
231+
},
232+
{
233+
"name": "8.4-oci8-swoole-nginx",
234+
"data": {
235+
"from": "kooldev/php:8.4-swoole-nginx"
236+
},
237+
"files": [
238+
{
239+
"name": "Dockerfile",
240+
"path": "template/Dockerfile"
241+
}
242+
]
195243
}
196244
]
197245
}

kool.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ scripts:
2222
- docker build --pull -t kooldev/php:8.3-oci8-swoole-nginx 8.3-oci8-swoole-nginx
2323
- docker build --pull -t kooldev/php:8.3-oci8-swoole-nginx-prod 8.3-oci8-swoole-nginx-prod
2424
- docker build --pull -t kooldev/php:8.3-oci8-swoole-nginx-prod 8.3-oci8-swoole-nginx-prod
25+
- docker build --pull -t kooldev/php:8.4-oci8-nginx 8.4-oci8-nginx
26+
- docker build --pull -t kooldev/php:8.4-oci8-nginx-prod 8.4-oci8-nginx-prod
27+
- docker build --pull -t kooldev/php:8.4-oci8-swoole-nginx 8.4-oci8-swoole-nginx
28+
- docker build --pull -t kooldev/php:8.4-oci8-swoole-nginx-prod 8.4-oci8-swoole-nginx-prod

template/Dockerfile.blade.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44
ENV ORACLE_HOME /usr/local/instantclient
55

66
# Download and unarchive Instant Client v11
7+
@php
8+
preg_match('/:(\d+\.\d+)/', $from, $matches);
9+
$phpVersion = isset($matches[1]) ? (float)$matches[1] : 0;
10+
@endphp
11+
@if($phpVersion >= 8.4)
12+
RUN apk add --update libaio libnsl $PHPIZE_DEPS && \
13+
curl -o /tmp/instaclient-basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \
14+
curl -o /tmp/instaclient-sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \
15+
curl -o /tmp/instaclient-sqlplus.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip && \
16+
unzip -d /usr/local/ /tmp/instaclient-basic.zip && \
17+
unzip -d /usr/local/ /tmp/instaclient-sdk.zip && \
18+
unzip -d /usr/local/ /tmp/instaclient-sqlplus.zip && \
19+
ln -s /usr/local/instantclient_11_2 ${ORACLE_HOME} && \
20+
ln -s ${ORACLE_HOME}/libclntsh.so.* ${ORACLE_HOME}/libclntsh.so && \
21+
ln -s ${ORACLE_HOME}/libocci.so.* ${ORACLE_HOME}/libocci.so && \
22+
ln -s ${ORACLE_HOME}/lib* /usr/lib && \
23+
ln -s ${ORACLE_HOME}/sqlplus /usr/bin/sqlplus && \
24+
ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \
25+
echo "instantclient,${ORACLE_HOME}" | pecl install oci8 && \
26+
docker-php-ext-enable oci8 && \
27+
apk del $PHPIZE_DEPS
28+
@else
729
RUN apk add --update libaio libnsl && \
830
curl -o /tmp/instaclient-basic.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-basic-linux.x64-11.2.0.4.0.zip && \
931
curl -o /tmp/instaclient-sdk.zip https://raw.githubusercontent.com/bumpx/oracle-instantclient/master/instantclient-sdk-linux.x64-11.2.0.4.0.zip && \
@@ -19,3 +41,4 @@
1941
ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \
2042
docker-php-ext-configure oci8 --with-oci8=instantclient,$ORACLE_HOME && \
2143
docker-php-ext-install oci8
44+
@endif

0 commit comments

Comments
 (0)