-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update SNFLK and Synapse drivers use PHP8.1
- Loading branch information
Showing
11 changed files
with
188 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
FROM quay.io/keboola/aws-cli | ||
ARG AWS_SECRET_ACCESS_KEY | ||
ARG AWS_ACCESS_KEY_ID | ||
RUN /usr/bin/aws s3 cp s3://keboola-drivers/teradata/tdodbc1710-17.10.00.08-1.x86_64.deb /tmp/teradata/tdodbc.deb | ||
RUN /usr/bin/aws s3 cp s3://keboola-drivers/exasol/EXASOL_ODBC-7.1.10.tar.gz /tmp/exasol/odbc.tar.gz | ||
|
||
FROM php:7.4-cli-buster | ||
|
||
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction" | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
ENV COMPOSER_PROCESS_TIMEOUT 3600 | ||
|
||
ARG SQLSRV_VERSION=5.10.1 | ||
ARG SNOWFLAKE_ODBC_VERSION=2.25.6 | ||
ARG SNOWFLAKE_GPG_KEY=630D9F3CAB551AF3 | ||
|
||
WORKDIR /code/ | ||
|
||
COPY docker/php-prod.ini /usr/local/etc/php/php.ini | ||
COPY docker/composer-install.sh /tmp/composer-install.sh | ||
|
||
RUN apt-get update -q \ | ||
&& apt-get install gnupg -y --no-install-recommends \ | ||
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ | ||
&& curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list \ | ||
&& apt-get update -q \ | ||
&& ACCEPT_EULA=Y apt-get install -y --no-install-recommends\ | ||
git \ | ||
locales \ | ||
unzip \ | ||
unixodbc \ | ||
unixodbc-dev \ | ||
libpq-dev \ | ||
gpg \ | ||
debsig-verify \ | ||
dirmngr \ | ||
gpg-agent \ | ||
msodbcsql17 \ | ||
libonig-dev \ | ||
libxml2-dev \ | ||
&& rm -r /var/lib/apt/lists/* \ | ||
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \ | ||
&& locale-gen \ | ||
&& chmod +x /tmp/composer-install.sh \ | ||
&& /tmp/composer-install.sh | ||
|
||
ENV LANGUAGE=en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
# Snowflake ODBC | ||
# https://github.com/docker-library/php/issues/103#issuecomment-353674490 | ||
RUN set -ex; \ | ||
docker-php-source extract; \ | ||
{ \ | ||
echo '# https://github.com/docker-library/php/issues/103#issuecomment-353674490'; \ | ||
echo 'AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl'; \ | ||
echo; \ | ||
cat /usr/src/php/ext/odbc/config.m4; \ | ||
} > temp.m4; \ | ||
mv temp.m4 /usr/src/php/ext/odbc/config.m4; \ | ||
docker-php-ext-configure odbc --with-unixODBC=shared,/usr; \ | ||
docker-php-ext-install odbc; \ | ||
docker-php-source delete | ||
|
||
|
||
|
||
#Synapse ODBC | ||
RUN set -ex; \ | ||
pecl install sqlsrv-$SQLSRV_VERSION pdo_sqlsrv-$SQLSRV_VERSION; \ | ||
docker-php-ext-enable sqlsrv pdo_sqlsrv; \ | ||
docker-php-source delete | ||
|
||
## Snowflake | ||
COPY ./docker/snowflake/generic.pol /etc/debsig/policies/$SNOWFLAKE_GPG_KEY/generic.pol | ||
COPY ./docker/snowflake/simba.snowflake.ini /usr/lib/snowflake/odbc/lib/simba.snowflake.ini | ||
|
||
RUN mkdir -p ~/.gnupg \ | ||
&& chmod 700 ~/.gnupg \ | ||
&& echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \ | ||
&& mkdir -p /usr/share/debsig/keyrings/$SNOWFLAKE_GPG_KEY \ | ||
&& gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys $SNOWFLAKE_GPG_KEY \ | ||
&& gpg --export $SNOWFLAKE_GPG_KEY > /usr/share/debsig/keyrings/$SNOWFLAKE_GPG_KEY/debsig.gpg \ | ||
&& curl https://sfc-repo.snowflakecomputing.com/odbc/linux/$SNOWFLAKE_ODBC_VERSION/snowflake-odbc-$SNOWFLAKE_ODBC_VERSION.x86_64.deb --output /tmp/snowflake-odbc.deb \ | ||
&& debsig-verify /tmp/snowflake-odbc.deb \ | ||
&& gpg --batch --delete-key --yes $SNOWFLAKE_GPG_KEY \ | ||
&& dpkg -i /tmp/snowflake-odbc.deb | ||
|
||
# Teradata | ||
COPY --from=0 /tmp/teradata/tdodbc.deb /tmp/teradata/tdodbc.deb | ||
COPY docker/teradata/odbc.ini /tmp/teradata/odbc_td.ini | ||
COPY docker/teradata/odbcinst.ini /tmp/teradata/odbcinst_td.ini | ||
|
||
RUN dpkg -i /tmp/teradata/tdodbc.deb \ | ||
&& cat /tmp/teradata/odbc_td.ini >> /etc/odbc.ini \ | ||
&& cat /tmp/teradata/odbcinst_td.ini >> /etc/odbcinst.ini \ | ||
&& rm -r /tmp/teradata \ | ||
&& docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \ | ||
&& docker-php-ext-install pdo_odbc \ | ||
&& docker-php-source delete | ||
|
||
ENV ODBCHOME = /opt/teradata/client/ODBC_64/ | ||
ENV ODBCINI = /opt/teradata/client/ODBC_64/odbc.ini | ||
ENV ODBCINST = /opt/teradata/client/ODBC_64/odbcinst.ini | ||
ENV LD_LIBRARY_PATH = /opt/teradata/client/ODBC_64/lib | ||
|
||
#Exasol | ||
COPY --from=0 /tmp/exasol/odbc.tar.gz /tmp/exasol/odbc.tar.gz | ||
RUN set -ex; \ | ||
mkdir -p /tmp/exasol/odbc /opt/exasol ;\ | ||
tar -xzf /tmp/exasol/odbc.tar.gz -C /tmp/exasol/odbc --strip-components 1; \ | ||
cp /tmp/exasol/odbc/lib/linux/x86_64/libexaodbc-uo2214lv2.so /opt/exasol/;\ | ||
echo "\n[exasol]\nDriver=/opt/exasol/libexaodbc-uo2214lv2.so\n" >> /etc/odbcinst.ini;\ | ||
rm -rf /tmp/exasol; | ||
|
||
## Composer - deps always cached unless changed | ||
# First copy only composer files | ||
COPY composer.* /code/ | ||
# Download dependencies, but don't run scripts or init autoloaders as the app is missing | ||
RUN composer install $COMPOSER_FLAGS --no-scripts --no-autoloader | ||
# copy rest of the app | ||
COPY . /code/ | ||
# run normal composer - all deps are cached already | ||
RUN composer install $COMPOSER_FLAGS | ||
|
||
CMD ["php", "/code/src/run.php"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
packages/php-table-backend-utils/docker/snowflake/generic.pol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE Policy SYSTEM "http://www.debian.org/debsig/1.0/policy.dtd"> | ||
<Policy xmlns="https://www.debian.org/debsig/1.0/"> | ||
<Origin Name="Snowflake Computing" id="EC218558EABB25A1" Description="Snowflake ODBC Driver DEB package"/> | ||
<Origin Name="Snowflake Computing" id="630D9F3CAB551AF3" Description="Snowflake ODBC Driver DEB package"/> | ||
<Selection> | ||
<Required Type="origin" File="debsig.gpg" id="EC218558EABB25A1"/> | ||
<Required Type="origin" File="debsig.gpg" id="630D9F3CAB551AF3"/> | ||
</Selection> | ||
<Verification MinOptional="0"> | ||
<Required Type="origin" File="debsig.gpg" id="EC218558EABB25A1"/> | ||
<Required Type="origin" File="debsig.gpg" id="630D9F3CAB551AF3"/> | ||
</Verification> | ||
</Policy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Project"> | ||
<rule ref="vendor/keboola/coding-standard/src/ruleset.xml"/> | ||
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"> | ||
<properties> | ||
<property name="enableUnionTypeHint" type="bool" value="false" /> | ||
<property name="enableIntersectionTypeHint" type="bool" value="false" /> | ||
<property name="enableStandaloneNullTrueFalseTypeHints" type="bool" value="false" /> | ||
</properties> | ||
</rule> | ||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"> | ||
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint.MissingTraversableReturnTypeHintSpecification"/> | ||
<properties> | ||
<property name="enableStaticTypeHint" type="bool" value="false" /> | ||
<property name="enableMixedTypeHint" type="bool" value="false" /> | ||
<property name="enableUnionTypeHint" type="bool" value="false" /> | ||
<property name="enableIntersectionTypeHint" type="bool" value="false" /> | ||
<property name="enableNeverTypeHint" type="bool" value="false" /> | ||
<property name="enableStandaloneNullTrueFalseTypeHints" type="bool" value="false" /> | ||
</properties> | ||
</rule> | ||
|
||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters