|
4 | 4 | ENV ORACLE_HOME /usr/local/instantclient |
5 | 5 |
|
6 | 6 | # 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 |
7 | 29 | RUN apk add --update libaio libnsl && \ |
8 | 30 | 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 | 31 | 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 | 41 | ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1 && \ |
20 | 42 | docker-php-ext-configure oci8 --with-oci8=instantclient,$ORACLE_HOME && \ |
21 | 43 | docker-php-ext-install oci8 |
| 44 | +@endif |
0 commit comments