在Docker容器中连接到PyodBC的问题
早上好,
我的docker容器和pyodbc / unixoDBC-dev遇到了以下问题。
运行我的Python API连接到我的Docker容器时,我会收到以下错误消息 -
(pyodbc.Error) ('01000', "[01000] [unixODBC][Driver
Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)"
使用本地调试实例连接到同一API,一切都很好 - 我可以在后端数据库中提交一个字符串,并返回结果并送回邮递员UI。
我看到docker映像中安装的UnixODBC-DEV DEV 2.3.6-0.1 AMD64,我注意到UnixoDBC为2.3.11-不知道是否有任何问题,但说我们的月经实例可以' t连接到 http://deb.debian.org ,要让我们的安全集团打开它,这是下一个不可能。
话虽这么说,我想知道我在码头容器中是否有任何配置的东西,这引起了我的问题。我是Docker容器世界的新手,所以这绝对是我走的学习。
蒂亚, 比尔·扬曼(Bill Youngman)
Good Morning,
I am having the following issue with my Docker container and pyodbc / unixodbc-dev.
When running my Python API connecting to my Docker container I get the following error message--
(pyodbc.Error) ('01000', "[01000] [unixODBC][Driver
Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)"
Connecting to the same API using my local debug instance everything is working fine -- I can submit a string for searching in the backend database and I get results returned and sent back to the Postman UI.
I see that unixodbc-dev dev 2.3.6-0.1 amd64 installed in the Docker image and I noticed that unixODBC is at 2.3.11 - don't know if there might be any issue with that but that being said our Moonshot instances can't connect to http://deb.debian.org and to get our security group to open it up is next to impossible.
All this being said I'm wondering if I have something configured wrong in my Docker container that is causing my issues. I'm new to the Docker container world so this is definitely a learn as I go.
TIA,
Bill Youngman
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够解决这个问题 - 感谢 mb 对于我正在寻找的解决方案。
我能够从此安装Alpine Linux中的Debian建议。 Docker容器并为我的需求进行修改。
这是我用来满足下载UnixODBC以及下载和安装MS SQL ODBC驱动程序的代码。
完成此操作后,我建造并部署了我的容器,一切正常。
-账单
I was able to get this figured out - thanks to m.b. for the solution I was looking for.
I was able to take the Debian suggestion from this Install ODBC driver in Alpine Linux Docker Container and modify it for my needs.
This is the code that I used to meet my requirements of downloading unixOdbc as well as downloading and installing the MS Sql ODBC driver.
Once this was accomplished and I built and deployed my container everything worked perfectly.
-Bill