-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add this driver to the alpine linux php docker image #300
Comments
AFAIK, the ODBC driver from Microsoft is not compatible with Alpine because of musl's libc. |
@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. |
Not sure, but may be this can help with libc: https://github.com/docker/compose/blob/master/Dockerfile.run |
Can it work with http://www.unixodbc.org/? Alpine already has in repositories |
Any progress on that? |
Any updates? |
@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, |
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? |
perhaps this image is suitable for installing msphpsql https://github.com/frol/docker-alpine-glibc |
It would be awesome to see support for Alpine |
Dear Microsoft, please note that everybody is creating containers on Alpine distro's, could you please help my DevOps life? Br |
It would be awesome to see support for Alpine Linux 👍 |
update..? |
It's in our backlog, but as @David-Engel said above:
|
Is there any progress? |
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
<#300 (comment)>,
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>
|
Isn't it the other way around? The open source community doesn't struggle. |
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. |
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. |
looking for msodbcsql17 for alpine too |
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));
}
Tried to make frankenstein with FROM frolvlad/alpine-glibc alpine with glibc hackish way
alpine glibc version doesn't have docker-php-ext-install
So fallbacked to pecl install with apk add g++ make |
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 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. |
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. |
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 ***@***.***> 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
<#300 (comment)>
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
<#300?email_source=notifications&email_token=ACZTUU45FEU2P2N25S3N5M3P7443BA5CNFSM4DBHR4P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2E2J3Y#issuecomment-512337135>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACZTUUYEHF4BSLE4W63U7FLP7443BANCNFSM4DBHR4PQ>
.
|
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. |
Far from being ready. The pecl compilation for the php extensions fails with:
Plus, there are errors on the MS instructions page. curls missing the -O option, and also the file names for verification being wrong (not matched what was downloaded). |
Thanks for the update. We will double check the documentation. |
This is what I did on an alpine-based Dockerfile to install it: RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.1.1-1_amd64.apk && \
wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/mssql-tools_17.5.1.1-1_amd64.apk && \
apk add --allow-untrusted msodbcsql17_17.5.1.1-1_amd64.apk && \
apk add --allow-untrusted mssql-tools_17.5.1.1-1_amd64.apk && \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
pecl install pdo_sqlsrv && \
docker-php-ext-enable pdo_sqlsrv && \
apk del .phpize-deps && \
rm msodbcsql17_17.5.1.1-1_amd64.apk && \
rm mssql-tools_17.5.1.1-1_amd64.apk I'm about to test if it works, but it compiled with no errors. |
Thanks for the update @acelaya Just so you know, for 5.8.0 the support for Alpine is experimental. In particular, we do not currently recommend enabling both drivers because there are some known issues. If you do encounter new issues when using either sqlsrv or pdo_sqlsrv, please create a new issue for us to keep track. |
Thanks for the tip @yitam. I have just left Then I have done some tests and it seems to partially work, but I also get this error: By searching a bit you can find that's because of missing locale configuration. However, while it is easy to solve on other distros, it's not as easy to workaround on alpine. I will continue investigating. |
Thanks @acelaya |
Yeah!! That did the trick 😃 Everything is working on my set-up now. |
I just want to reiterate @yitam's comment. Alpine has some peculiar differences compared to other distributions. Given our testing and the issues we noted in the release notes, we were not confident calling this PHP release production-ready for Alpine. Our thought is to let it get run through some paces by others and identify any issues, so please file them in this repo if you encounter them. If we need to, we can release an update to address any critical issues. |
So for me using @acelaya 's instructions (modified) I was able to install everything, including both pecl extensions. However, upon testing, I am getting:
With this happening at the |
@bkraul This is a known issue. If possible, you can work around it by setting |
@david-puglielli Thanks. That did work. I am assuming at some point specifying this will not be needed? And are there any known complications with the use of UTF-8 for connections where it hasn't been used before? |
@yitam I'm trying to figure out where I am supposed to place the
|
@bkraul when we were testing adding |
@yitam That seems to do the trick. Thank you for your quick replies. Very excited at the prospect of this going on prod soon. It slashes my image size by 2/3!! |
Just a little detail: the pt-br version of documentation does not contain the |
Translation of the online docs is automated and out of our control. It's probably just taking a while or something is stuck in whatever translation pipeline the doc team uses. I assume it will get there eventually. |
Hi all, please note that 5.8.1 hotfix is released! The workarounds mentioned above are no longer required. Please try it out and let us know if you run into any issues. |
In case you guys are still looking for a minimal "mssql-tools" with Alpine. I was able to create one, you can find the Dockerfile here. Let me know if you have any questions or comments. Cheers, |
It was a bit tricky getting the combination of pecl commands and tracking down the odbc drivers(which aren't mentioned in the documentation) but once I did it was seamless. Nice to walk away from a new segfault in FreeTDS instead of tracing it out and just being able to use this. Thank you! Keep up the great work! |
Thanks @neclimdul and glad that it works for you! In case anyone else is looking for the documentation for installing sqlsrv drivers in Alpine Linux, this is the section for Alpine 3.11, which references the ODBC Driver 17 |
@yitam sorry. yeah that was perfect but I found that documentation here. I meant its not documented in the php extension install instructions here: https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15 |
oh no it is i just hadn't found it... ignore all the noise. Sorry everyone :( |
Is there any work done to get the sql driver direct into official alpine packages, so that
is enough? |
No, @StefanSchoof , but please check this out: I wrote a simple shell script
Write a simple php script for checking client info:
This is the Dockerfile I've tested:
|
Its works for me as well , but I'm getting this error. Any Idea ? |
@aniruddha-dnb please provide MsSQL version and keep in mind that latest versions require latest version of libraries As well as I see no info about your connection, seems you have incorrect config and try to connect to host IP Please provide the |
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:
docker-php-ext-install
will pull the driver.The text was updated successfully, but these errors were encountered: