Comments (4)
@Relent97 Could you be more specific to the issue? Not sure what the issue is.
Let us know what the issue is, when do you get it and how you're using it and probably we can help you out. Thanks!
from pyodbc.
Hi @kabirbaidhya , Thanks for your response.
So the issue can be best be explained in an example. I built my docker image yesterday using the base Dockerfile in your repository with some minor changes.The container would build successfuly and run pulling the data from from a specified db in my Azure environment.
The problem is that, if i check the app today, the app does not pull any data for today from the DB. It's as if it only pulls data when the image is built and does not update itself hence losing it's dynamism.
Below is the syntax
FROM python:3.7-slim AS base
COPY requirements.txt .
Setup dependencies for pyodbc
RUN
export ACCEPT_EULA='Y' &&
export MYSQL_CONNECTOR='mysql-connector-odbc-8.0.18-linux-glibc2.12-x86-64bit' &&
export MYSQL_CONNECTOR_CHECKSUM='f2684bb246db22f2c9c440c4d905dde9' &&
apt-get update &&
apt-get install -y curl build-essential unixodbc-dev g++ apt-transport-https &&
gpg --keyserver hkp://keys.gnupg.net --recv-keys 5072E1F5 && \
Install pyodbc db drivers for MSSQL, PG and MySQL
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - &&
curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list &&
curl -L -o ${MYSQL_CONNECTOR}.tar.gz https://dev.mysql.com/get/Downloads/Connector-ODBC/8.0/${MYSQL_CONNECTOR}.tar.gz &&
curl -L -o ${MYSQL_CONNECTOR}.tar.gz.asc https://downloads.mysql.com/archives/gpg/\?file\=${MYSQL_CONNECTOR}.tar.gz\&p\=10 &&
gpg --verify ${MYSQL_CONNECTOR}.tar.gz.asc &&
echo "${MYSQL_CONNECTOR_CHECKSUM} ${MYSQL_CONNECTOR}.tar.gz" | md5sum -c - &&
apt-get update &&
gunzip ${MYSQL_CONNECTOR}.tar.gz && tar xvf ${MYSQL_CONNECTOR}.tar &&
cp ${MYSQL_CONNECTOR}/bin/* /usr/local/bin && cp ${MYSQL_CONNECTOR}/lib/* /usr/local/lib &&
myodbc-installer -a -d -n "MySQL ODBC 8.0 Driver" -t "Driver=/usr/local/lib/libmyodbc8w.so" &&
myodbc-installer -a -d -n "MySQL ODBC 8.0" -t "Driver=/usr/local/lib/libmyodbc8a.so" &&
apt-get install -y msodbcsql17 odbc-postgresql && \
Update odbcinst.ini to make sure full path to driver is listed
sed 's/Driver=psql/Driver=/usr/lib/x86_64-linux-gnu/odbc/psql/' /etc/odbcinst.ini > /tmp/temp.ini &&
mv -f /tmp/temp.ini /etc/odbcinst.ini && \
Install dependencies
pip install --upgrade pip &&
pip install -r requirements.txt && rm requirements.txt && \
Cleanup build dependencies
rm -rf ${MYSQL_CONNECTOR}* &&
apt-get remove -y curl apt-transport-https debconf-utils g++ gcc rsync unixodbc-dev build-essential gnupg2 &&
apt-get autoremove -y && apt-get autoclean -y
RUN mkdir /app
WORKDIR /app
ADD requirements.txt /app/
RUN pip install -r requirements.txt
ADD . /app/
ENTRYPOINT ["python3", "app.py"]
from pyodbc.
@Relent97 I'm still not clear about your issue. Also, I don't think this issue is related to the laudio/pyodbc
image since it seems you're not using it and are building your own using the dockerfile code as a reference. So, I'm closing this issue.
Anyway, I can suggest following:
- You're creating your own image from scratch with
python:3.7-slim
as base - is this required? You could have used this image as a base or have extended from it in case you need custom chnages. - If you're looking for building your own image then perhaps you should go through the issue thread mkleehammer/pyodbc#276 and see if any other issues here answers your question https://github.com/mkleehammer/pyodbc/issues.
from pyodbc.
Thank you for the pointers @kabirbaidhya
from pyodbc.
Related Issues (16)
- Setup an example project using mssql HOT 1
- Setup an example project using postgres HOT 3
- Setup an example data pipeline task (container) for data transfer using pyodbc - mssql
- Release and CI - avoid automatic releasing / publishing of new image if there aren't any changes in the image HOT 1
- Setup an example data pipeline task (container) for data transfer using pyodbc - pg HOT 1
- Example improvements - Print the number of rows transferred HOT 1
- Add static typing for all the python code base HOT 1
- Configure and Integrate microsoft/pyright in the CI to enforce static typing HOT 2
- Generate significant fake data for the examples using faker HOT 4
- CI - Integrate a linter and have it fail for PRs / branches for lint errors
- Add examples for usage with MySQL HOT 2
- Support MySQL and add tests to verify database connection works HOT 3
- Verify checksum of MYSQL_CONNECTOR
- Move from Docker Hub to GitHub Registry HOT 1
- Image support for ARM64 arch HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodbc.