msphpsql icon indicating copy to clipboard operation
msphpsql copied to clipboard

Add this driver to the alpine linux php docker image

Open zippy1981 opened this issue 7 years ago • 59 comments

Alpine linux uses a smaller libc than ubuntu and redhat and produces really small docker images. There are official php docker images on docker hub that use this. One installs an extension on them via the command docker-php-ext-install this compiles the extension from source and setups up an INI file for it.

I have not determined if any of the following tasks are already done:

  1. Compile this driver on alpine linux. If this works can someone at MSFT setup travis CI to do this?
  2. Get whoever maintains the alpine linux php docker images on board with this
  3. Create a pull request so docker-php-ext-install will pull the driver.

zippy1981 avatar Feb 23 '17 12:02 zippy1981

AFAIK, the ODBC driver from Microsoft is not compatible with Alpine because of musl's libc.

mimetnet avatar Feb 23 '17 16:02 mimetnet

@zippy1981 We can get the PHP Driver to compile on Alpine Linux but the ODBC Driver as @mimetnet mentioned, is not compatible with Alpine. We do have a docker image that you can use for now: https://hub.docker.com/r/lbosqmsft/php-mssql/. We are looking into supporting additional distros (alpine, debian etc.) We will keep you posted.

meet-bhagdev avatar Feb 25 '17 04:02 meet-bhagdev

Not sure, but may be this can help with libc: https://github.com/docker/compose/blob/master/Dockerfile.run

avarabei avatar Mar 19 '17 20:03 avarabei

Can it work with http://www.unixodbc.org/? Alpine already has in repositories

csandanov avatar Jul 27 '17 04:07 csandanov

Any progress on that?

csandanov avatar Sep 22 '17 06:09 csandanov

Any updates?

ruudboon avatar Feb 20 '18 13:02 ruudboon

@ruudboon No updates. Alpine still is not a supported Linux distribution for the ODBC Driver. We will keep Alpine in mind as we evaluate supporting additional distributions.

Regards, David

David-Engel avatar Feb 26 '18 22:02 David-Engel

This is becoming a dealbreaker for me, especially as I attempt to put more of my apps into docker, using alpine, which is more-or-less best practice for most situations.

Is there any way, even with some hacks, to get this working in alpine?

benyanke avatar Apr 09 '18 20:04 benyanke

perhaps this image is suitable for installing msphpsql https://github.com/frol/docker-alpine-glibc

rommkaa avatar Jul 19 '18 09:07 rommkaa

It would be awesome to see support for Alpine

thsmrtone1 avatar Jul 23 '18 14:07 thsmrtone1

Dear Microsoft, please note that everybody is creating containers on Alpine distro's, could you please help my DevOps life?

Br

alsilva86 avatar Aug 20 '18 19:08 alsilva86

It would be awesome to see support for Alpine Linux 👍

romeugodoi avatar Sep 19 '18 21:09 romeugodoi

update..?

ikwijaya avatar Sep 26 '18 03:09 ikwijaya

It's in our backlog, but as @David-Engel said above:

No updates. Alpine still is not a supported Linux distribution for the ODBC Driver. We will keep Alpine in mind as we evaluate supporting additional distributions.

yitam avatar Sep 26 '18 15:09 yitam

Is there any progress?

herojhc avatar Nov 08 '18 07:11 herojhc

There will "never" be. Thats why the open source community struggles so much against Java and other technologies. Very academic interests point of view, only. We simply gave up using Alpine and moved on.

Em qui, 8 de nov de 2018 às 05:30, herojhc [email protected] escreveu:

Is there any progress?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/msphpsql/issues/300#issuecomment-436899033, or mute the thread https://github.com/notifications/unsubscribe-auth/ALM6U3zWybsBZiW9qScI8dHpuowcYroJks5us92sgaJpZM4MJ48f .

--

Andre Luiz / IT and Trading [email protected] / +55 11 984129269

[image: Linkedin] http://br.linkedin.com/in/bahuan[image: skype] http://alosilva86

alsilva86 avatar Nov 08 '18 11:11 alsilva86

Thats why the open source community struggles so much against Java and other technologies

Isn't it the other way around? The open source community doesn't struggle. Microsoft struggles to support new technology like docker / alpine.

SanderSander avatar Nov 16 '18 19:11 SanderSander

We simply gave up using Alpine and moved on.

That's easy for you to say, but alpine provides a benefit to many users, and many containers and environments are build on it. It's far from "academic." It's "I have hundreds of alpine containers, and if this driver doesn't work on alpine, I can't use it."

By not supporting alpine, they're not supporting a place where their users want to run their software.

benyanke avatar Nov 16 '18 19:11 benyanke

Microsoft struggles to support new technology like docker / alpine.

Microsoft fully supports Docker containers and is very much on board with that model. Alpine is just one Linux distribution that happens to be optimized for the container model.

Supporting another platform is not just adding some code and some tests to your existing code base and CI. It also means ensuring all your dependencies are on the new platform, creating new packaging and new test (and probably build) infrastructure that has to be maintained going forward. That all costs money and money is not infinite so people have to prioritize. Alpine has a lot going for it and it is getting a lot of traction in the container world. That has not gone unnoticed.

David-Engel avatar Nov 16 '18 23:11 David-Engel

looking for msodbcsql17 for alpine too maybe it's time to move to centos ......

mchenx avatar Apr 18 '19 13:04 mchenx

One more 👍 thumbsup vote for Microsoft ODBC support for alpine

Currently test script doesn't work.

php -i | grep sqlsrv
/etc/php7/conf.d/30-sqlsrv.ini,
/etc/php7/conf.d/35-pdo_sqlsrv.ini,
Registered PHP Streams => compress.zlib, https, ftps, php, file, glob, data, http, ftp, zip, phar, sqlsrv
PDO drivers => dblib, sqlsrv
pdo_sqlsrv
pdo_sqlsrv support => enabled
pdo_sqlsrv.client_buffer_max_kb_size => 10240 => 10240
pdo_sqlsrv.log_severity => 0 => 0
sqlsrv
sqlsrv support => enabled
<?php

$conn_array = array (
    "UID" => "sa",
    "PWD" => "secretpassword",
    "Database" => "testdatabase",
);
$conn = sqlsrv_connect("192.168.1.3, 5555", $conn_array);
if ($conn){
    echo "connected";
    if(($result = sqlsrv_query($conn,"SELECT * FROM dbo.table")) !== false){
        while( $obj = sqlsrv_fetch_object( $result )) {
              echo $obj->colName.'<br />';
        }
    }
}else{
    die(print_r(sqlsrv_errors(), true));
}
Array
(
    [0] => Array
        (
            [0] => IMSSP
            [SQLSTATE] => IMSSP
            [1] => -49
            [code] => -49
            [2] => This extension requires the Microsoft ODBC Driver for SQL Server. Access the following URL to download the ODBC Driver for SQL Server for x64: https://go.microsoft.com/fwlink/?LinkId=163712
            [message] => This extension requires the Microsoft ODBC Driver for SQL Server. Access the following URL to download the ODBC Driver for SQL Server for x64: https://go.microsoft.com/fwlink/?LinkId=163712
        )
)

Tried to make frankenstein with FROM frolvlad/alpine-glibc alpine with glibc hackish way

bash-4.4# apk add nano
(1/2) Installing libmagic (5.36-r0)
(2/2) Installing nano (3.2-r0)
Executing busybox-1.29.3-r10.trigger
Executing glibc-bin-2.29-r0.trigger
/usr/glibc-compat/sbin/ldconfig: /usr/lib/libsodium.so.23 is not a symbolic link

OK: 78 MiB in 92 packages
bash-4.4# ldd /usr/lib/libsodium.so.23
	ldd (0x7f60dfa83000)
	libc.musl-x86_64.so.1 => ldd (0x7f60dfa83000)

alpine glibc version doesn't have docker-php-ext-install

+ docker-php-ext-install pdo_dblib
/bin/sh: docker-php-ext-install: not found

So fallbacked to pecl install with apk add g++ make

ghost avatar May 14 '19 10:05 ghost

I would also like for this to happen, does anyone know the team internally at Microsoft? I would like to try and work with them.

Please, DM me if you have any contacts at Microsoft that can help with this situation or if you know the team working on it.

ZaxLofful avatar Jul 16 '19 21:07 ZaxLofful

@ZaxLofful Most of the top contributors here are working for Microsoft. I'm the PM for drivers for SQL Server. Alpine support is on the roadmap for the ODBC and PHP drivers. It's just a matter of getting it prioritized and funded. See my previous comment for details. Upvoting this issue provides the best user feedback to the right people for getting Alpine support prioritized.

David-Engel avatar Jul 17 '19 15:07 David-Engel

@David-Engel

It's just a matter of getting it prioritized and funded.

It would be so nice to use alpine based containers connecting to mssql containers, and mssql is a good product right? The funds shouldn't be a problem (my opinion) cause the entry level for using mssql would be lower when the drivers are easily integrated. I mean there are so much use-cases to prefer mssql above other sql solutions.

SanderSander avatar Jul 17 '19 18:07 SanderSander

I agree with you, this is the kind of issue that makes the relevance/demand to be a priority.

On Wed, Jul 17, 2019, 12:43 David Engel [email protected] wrote:

@ZaxLofful https://github.com/ZaxLofful Most of the top contributors here are working for Microsoft. I'm the PM for drivers for SQL Server. Alpine support is on the roadmap for the ODBC and PHP drivers. It's just a matter of getting it prioritized and funded. See my previous comment https://github.com/microsoft/msphpsql/issues/300#issuecomment-439560083 for details. Upvoting this issue provides the best user feedback to the right people for getting Alpine support prioritized.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/msphpsql/issues/300?email_source=notifications&email_token=ACZTUU45FEU2P2N25S3N5M3P7443BA5CNFSM4DBHR4P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2E2J3Y#issuecomment-512337135, or mute the thread https://github.com/notifications/unsubscribe-auth/ACZTUUYEHF4BSLE4W63U7FLP7443BANCNFSM4DBHR4PQ .

alsilva86 avatar Jul 17 '19 19:07 alsilva86

We've been using Pymssql, but are now being forced to switch to pyodbc due to the issue above. We're running Alpine on our containers, so we're hopeful that an Alpine-compatible driver can be released soon.

devrsw avatar Nov 19 '19 16:11 devrsw

@devrsw as mentioned above,

Alpine support is on the roadmap for the ODBC and PHP drivers.

Please stay tuned.

yitam avatar Nov 19 '19 16:11 yitam

@yitam That would be so cool. However, trying to keep realistic expectations....we have been waiting for such things as (official) AD authentication (in the case of mssql for linux), and been told "weeks to months", which have turned into years.... :)

bkraul avatar Nov 19 '19 16:11 bkraul

Ray of light: Alpine support in the MS ODBC Driver for SQL Server is being worked on right now and should be done for the next MS ODBC driver release. The PHP drivers are also planned to be released with Alpine support about the same time (obviously ODBC dependent).

David-Engel avatar Nov 21 '19 22:11 David-Engel

Ray of light: Alpine support in the MS ODBC Driver for SQL Server is being worked on right now and should be done for the next MS ODBC driver release. The PHP drivers are also planned to be released with Alpine support about the same time (obviously ODBC dependent).

Thank you. Can you please provide a rough next MS ODBC driver release date?

David-Magebinary avatar Nov 26 '19 04:11 David-Magebinary