potiuk commented on code in PR #35868:
URL: https://github.com/apache/airflow/pull/35868#discussion_r1406971850
##########
Dockerfile:
##########
@@ -342,87 +342,6 @@ if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
fi
EOF
-# The content below is automatically copied from
scripts/docker/install_mssql.sh
-COPY <<"EOF" /install_mssql.sh
-#!/usr/bin/env bash
-set -euo pipefail
-
-. "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
-
-: "${AIRFLOW_PIP_VERSION:?Should be set}"
-
-: "${INSTALL_MSSQL_CLIENT:?Should be true or false}"
-
-COLOR_BLUE=$'\e[34m'
-readonly COLOR_BLUE
-COLOR_RESET=$'\e[0m'
-readonly COLOR_RESET
-
-function install_mssql_client() {
- # Install MsSQL client from Microsoft repositories
- if [[ ${INSTALL_MSSQL_CLIENT:="true"} != "true" ]]; then
- echo
- echo "${COLOR_BLUE}Skip installing mssql client${COLOR_RESET}"
- echo
- return
- fi
- echo
- echo "${COLOR_BLUE}Installing mssql client${COLOR_RESET}"
- echo
- local distro
- local version
- distro=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
- version=$(lsb_release -rs)
- local driver=msodbcsql18
- curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg
--dearmor -o /usr/share/keyrings/microsoft-prod.gpg
- curl --silent https://packages.microsoft.com/keys/microsoft.asc | apt-key
add - >/dev/null 2>&1
- curl --silent
"https://packages.microsoft.com/config/${distro}/${version}/prod.list" > \
- /etc/apt/sources.list.d/mssql-release.list
- apt-get update -yqq
- apt-get upgrade -yqq
- ACCEPT_EULA=Y apt-get -yqq install -y --no-install-recommends "${driver}"
- rm -rf /var/lib/apt/lists/*
- apt-get autoremove -yqq --purge
- apt-get clean && rm -rf /var/lib/apt/lists/*
Review Comment:
I believe this part of the script COULD potentially be removed. This part is
there to install msodbcsql library from microsoft which is needed for the
mssql+pyodbc driver. However we would need to check if for example ODBC
provider can make use of it (likely it can use it, so removing the odbc
libraries might be potentially breaking for anyone who relies on it in the
"reference" image. We make no promises there, we can remove stuff from
reference image (we do not follow semver - image is just a convenience package
that people might extend and customise at will. So users are free to add what
they are missing in their own images if we remove something, but we try to
avoid it regardless.
All the three libraries add some size to the image (139 MB vs. 1.4 GB -
uncompressed) so ~10% but mssql is only a part of it (and likely small - maybe
20 MB max - probably much smaller) - so there is little reason why we would
like to remove it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]