我已经在容器内安装了pyodbc,unixodbc,但是在运行容器时出现以下错误。谁能帮我解决这个问题。
Recreating NewAPIPlatform001 ... done
Attaching to cross_sell_h2l_NewAPIPlatform001
NewAPIPlatform001 | 2019-11-02 10:58:14,382 — INFO — __main__ - run_API.py:24 - <module>() — Locating environment variables.
NewAPIPlatform001 | 2019-11-02 10:58:14,384 — INFO — __main__ - run_API.py:54 - <module>() — Getting data between 201910 and 201910.
NewAPIPlatform001 | Traceback (most recent call last):
NewAPIPlatform001 | File "run_API.py", line 61, in <module>
NewAPIPlatform001 | df = data.get_data(min_month=args['min_month'], max_month=args['max_month'])
NewAPIPlatform001 | File "/usr/src/NewAPIPlatform001/src/data/data.py", line 116, in get_data
NewAPIPlatform001 | conn = get_conn(database='CENTRAL_MART', choice='ware')
NewAPIPlatform001 | File "/usr/src/NewAPIPlatform001/src/data/data.py", line 61, in get_conn
NewAPIPlatform001 | pwd=os.environ.get('WARE_PWD'),
NewAPIPlatform001 | pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL server' : file not found (0) (SQLDriverConnect)")
NewAPIPlatform001 exited with code 1
My Docker-compose file looks like below:
FROM python:3.6
COPY . /usr/src/NewAPIPlatform001
WORKDIR /usr/src/NewAPIPlatform001
RUN apt-get update && apt-get install unixodbc-dev -y bash
RUN apt-get install -y msodbcsql17 unixodbc
RUN pip install -r requirements.txt