diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e2291c97..aeade516 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -52,6 +52,10 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 + with: + # https://github.com/tonistiigi/binfmt/issues/240 + # https://github.com/docker/buildx/issues/1170 + image: tonistiigi/binfmt:qemu-v7.0.0-28 - name: Set up Docker Buildx uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 diff --git a/shallow-server/Dockerfile b/shallow-server/Dockerfile index 4e585f35..94410f48 100644 --- a/shallow-server/Dockerfile +++ b/shallow-server/Dockerfile @@ -13,12 +13,19 @@ RUN apt-get update && \ php-dompdf php8.1-apcu redis-server php8.1-redis php8.1-smbclient \ php8.1-ldap unzip php8.1-pgsql php8.1-sqlite make apache2 \ php8.1-opcache libmagickcore-6.q16-2-extra \ - libapache2-mod-php8.1 && \ + libapache2-mod-php8.1 php-pear libaio1 build-essential expect && \ apt-get autoremove -y && apt-get autoclean && apt-get clean && \ rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* -COPY opcache-recommended.ini /etc/php/8.1/cli/conf.d/99-opcache-recommended.ini +# Oracle setup +COPY oci8-setup.sh /tmp/oci8-setup.sh +RUN chmod +x /tmp/oci8-setup.sh && \ + /tmp/oci8-setup.sh && \ + rm -f /tmp/oci8-setup.sh + COPY apc-cli-enable.ini /etc/php/8.1/cli/conf.d/99-apc-cli-enable.ini +COPY oci8-enable.ini /etc/php/8.1/apache2/conf.d/99-oci8-enable.ini +COPY opcache-recommended.ini /etc/php/8.1/cli/conf.d/99-opcache-recommended.ini WORKDIR /var/www/html diff --git a/shallow-server/oci8-enable.ini b/shallow-server/oci8-enable.ini new file mode 100644 index 00000000..d3f74189 --- /dev/null +++ b/shallow-server/oci8-enable.ini @@ -0,0 +1 @@ +extension=oci8.so diff --git a/shallow-server/oci8-setup.sh b/shallow-server/oci8-setup.sh new file mode 100644 index 00000000..4b7a0ad0 --- /dev/null +++ b/shallow-server/oci8-setup.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status. +set -e + +ORACLE_DIR="/opt/oracle/instantclient" + +# Remove existing files if they exist +[ -f "instantclient-basic-linuxx64.zip" ] && rm "instantclient-basic-linuxx64.zip" +[ -f "instantclient-sdk-linuxx64.zip" ] && rm "instantclient-sdk-linuxx64.zip" + +# Download Oracle Instant Client basic package +curl -kL "https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linuxx64.zip" > "instantclient-basic-linuxx64.zip" + +# Download Oracle Instant Client SDK package +curl -kL "https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip" > "instantclient-sdk-linuxx64.zip" + +# Unzip the downloaded files +echo "Unzipping downloaded files..." +unzip -o instantclient-basic-linuxx64.zip +unzip -o instantclient-sdk-linuxx64.zip + +# Create Oracle directory +echo "Creating Oracle directory..." +mkdir -p $ORACLE_DIR + +# Move Instant Client to the Oracle directory +echo "Moving Instant Client to the Oracle directory..." +mv instantclient*/* $ORACLE_DIR +ls -la $ORACLE_DIR + +# Create symbolic links +echo "Creating symbolic links..." +ln -sf $ORACLE_DIR/libclntsh.so.12.1 $ORACLE_DIR/libclntsh.so +ln -sf $ORACLE_DIR/libocci.so.12.1 $ORACLE_DIR/libocci.so + +# Configure dynamic linker run-time bindings +echo "Configuring dynamic linker run-time bindings..." +echo $ORACLE_DIR | tee /etc/ld.so.conf.d/oracle-instantclient.conf +ldconfig + +# Install OCI8 for PHP 8.2 +echo "Installing OCI8 extension for PHP 8.2..." +/usr/bin/expect <