File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- # This script is intended to be run by an Ubuntu dev container
3+ # This script is intended to be run by an Ubuntu development container
44
55# Exit immediately if any command returns a non-zero code
66set -e
77
88# Install OS-level dependencies
99
10- # Note that msodbcsql18 install requires the Microsoft APT repo to be available to this script. If this script is used
11- # in conjunction with a container image from the Microsoft container registry this should already be the case.
12- ALL_DEPENDENCIES=" libpq-dev netcat-traditional unixodbc-dev default-jdk msodbcsql18"
10+ # # Ensure that the Microsoft package repository is available as it is required for msodbcsql18. Note that the repository
11+ # # may have already been added by a development container feature (e.g. docker-in-docker or java).
12+ if apt-cache policy | grep -q ' packages.microsoft.com' ; then
13+ echo " Microsoft package repository already present"
14+ else
15+ echo " Microsoft package repository not present, it will be added."
16+
17+ # ref: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server
18+ curl -sSL -O https://packages.microsoft.com/config/ubuntu/$( grep VERSION_ID /etc/os-release | cut -d ' "' -f 2) /packages-microsoft-prod.deb
19+ sudo dpkg -i packages-microsoft-prod.deb
20+ rm packages-microsoft-prod.deb
21+ fi
1322
23+ ALL_DEPENDENCIES=" libpq-dev netcat-traditional unixodbc-dev default-jdk msodbcsql18"
1424sudo apt-get clean && sudo apt-get -y update && sudo ACCEPT_EULA=' Y' apt-get -y install $ALL_DEPENDENCIES
1525
1626# Install Python dependencies
You can’t perform that action at this time.
0 commit comments