Sign inSign up

dlesz/ubuntu_msodbc_python3

By dlesz

•Updated over 4 years ago

Ubuntu 20.04, Microsoft ODBC and Python 3 as default

Image
0

10K+

dlesz/ubuntu_msodbc_python3 repository overview

⁠Dockerfile:

FROM ubuntu:20.04

# install system utilities and dependencies
RUN apt update --fix-missing && \
    apt install -y bzip2 \
                   ca-certificates \
                   curl \
                   git \
                   gnupg2 \
                   g++ \
                   python3-pip \
                   neovim \
                   python3-neovim && \
    apt clean && rm -rf /var/lib/apt/lists/*

# adding custom MS repository
# https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#debian17
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list


# install SQL Server drivers
RUN apt update && ACCEPT_EULA=Y \
    apt install -y msodbcsql17 \
                   unixodbc-dev

RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile && \
    echo 'export PATH="$PATH:/opt/mssql-toolsh/bin"' >> ~/.bashrc

# python3 default in ubuntu
# https://stackoverflow.com/questions/55346068/how-do-i-alias-python2-to-python3-in-a-docker-container
RUN ln -sf /usr/bin/python3 /usr/bin/python && \
    ln -sf /usr/bin/pip3 /usr/bin/pip

Tag summary

Content type

Image

Digest

Size

213.2 MB

Last updated

over 4 years ago

docker pull dlesz/ubuntu_msodbc_python3