Skip to content

Commit 4f3b8df

Browse files
committed
The Docker image
1 parent da1729b commit 4f3b8df

File tree

6 files changed

+67
-3
lines changed

6 files changed

+67
-3
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
.vscode/
3+
.git/
4+
.gitignore
5+

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
.vscode/

Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Docker image with PYTHON3 and DEPENDENCIES for pyodbc with MS ODBC 17 DRIVER, Debian GNU/Linux 10 (buster)
2+
# BY TADEO RUBIO
3+
# Using the official Python image, Tag 3.8.3-buster
4+
FROM python:3.8.3-buster
5+
6+
# UPDATE APT-GET
7+
RUN apt-get update
8+
9+
# PYODBC DEPENDENCES
10+
RUN apt-get install -y tdsodbc unixodbc-dev
11+
RUN apt install unixodbc-bin -y
12+
RUN apt-get clean -y
13+
ADD odbcinst.ini /etc/odbcinst.ini
14+
15+
# UPGRADE pip3
16+
RUN pip3 install --upgrade pip
17+
18+
# DEPENDECES FOR DOWNLOAD ODBC DRIVER
19+
RUN apt-get install apt-transport-https
20+
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
21+
RUN curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list
22+
RUN apt-get update
23+
24+
# INSTALL ODBC DRIVER
25+
RUN ACCEPT_EULA=Y apt-get install msodbcsql17 --assume-yes
26+
27+
# CONFIGURE ENV FOR /bin/bash TO USE MSODBCSQL17
28+
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
29+
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 TadeoRubio
3+
Copyright (c) 2020 Tadeo Rubio
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
1-
# python-pyodbc-msodbcsql17
2-
Docker image to deploy apps on Python, using pyodbc and msodbcsql17
1+
# pyodbc-msodbcsql17
2+
3+
## Overview
4+
5+
This is a Docker image to deploy apps on Python 3, using pyodbc and Driver 17 for SQL Server®.
6+
7+
## Elements
8+
9+
Uses official image [Python 3.8.3-buster](https://hub.docker.com/_/python/)
10+
11+
1. Debian 10.0 (Buster)
12+
2. Python 3.8.3
13+
3. Dependencies tested for [Pyodbc 4.0.30](https://pypi.org/project/pyodbc/4.0.30/)
14+
4. Microsoft® ODBC SQL Server® 17 Driver installed
15+
16+
## Don't forget
17+
18+
This image haven't pyodbc yet, so please remember including on your deployment.
19+
20+
### License
21+
22+
See this [License](LICENSE)
23+
24+
### Trademark Notices
25+
26+
Microsoft® and SQL Server® are registered trademarks of Microsoft Corporation in the United States and/or other countries.

odbcinst.ini

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[FreeTDS]
2+
Description=FreeTDS Driver
3+
Driver=/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
4+
Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so

0 commit comments

Comments
 (0)