From 1789cd82ddbd392e5c5637f2bd29364ba3ca539b Mon Sep 17 00:00:00 2001 From: Alan Enrique Ontiveros Salazar Date: Mon, 25 Jul 2022 03:45:57 -0700 Subject: [PATCH] Add library libpq-dev for extension rdbms-connect in Docker --- src/azure-cli-core/azure/cli/core/extension/operations.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/azure-cli-core/azure/cli/core/extension/operations.py b/src/azure-cli-core/azure/cli/core/extension/operations.py index e0ed195cf75..db46f8938aa 100644 --- a/src/azure-cli-core/azure/cli/core/extension/operations.py +++ b/src/azure-cli-core/azure/cli/core/extension/operations.py @@ -249,6 +249,11 @@ def _install_deps_for_psycopg2(): # pylint: disable=too-many-statements if exit_code == 0: logger.debug("Install dependencies with '%s'", " ".join(zypper_install_cmd)) subprocess.call(zypper_install_cmd) + elif installer == 'DOCKER' or any(x in distname for x in ['alpine linux']): + apk_install_cmd = 'apk add --no-cache libpq-dev'.split() + logger.debug("Install dependencies with '%s'", " ".join(apk_install_cmd)) + logger.warning('This extension depends on libpq-dev and will be installed first.') + subprocess.call(apk_install_cmd) def is_valid_sha256sum(a_file, expected_sum):