From c6ef33a1c5c1c5ad90e2b849a9a1d147abe84d08 Mon Sep 17 00:00:00 2001 From: mima Date: Wed, 12 May 2021 09:56:10 +0200 Subject: [PATCH 1/2] install with pip forces to many dependencies to other pip azure modules e.g. version conflicts with requirements from https://github.com/ansible-collections/azure --- Dockerfile.template | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile.template b/Dockerfile.template index 944eb09..f1f7d6f 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -101,7 +101,15 @@ RUN if [ -n "${TERRAFORM_VERSION}" ] && [ "${TERRAFORM_VERSION}" != "latest" ]; RUN if [ -n "${AZ_CLI_VERSION}" ] && [ "${AZ_CLI_VERSION}" != "latest" ]; then AZ_CLI="azure-cli==${AZ_CLI_VERSION}";fi && \ if [ "${AZ_CLI_VERSION}" == "latest" ]; then AZ_CLI="azure-cli";fi && \ test -n "${AZ_CLI_VERSION}" && \ - pip3 install --no-cache-dir ${AZ_CLI} || : + rpm --import https://packages.microsoft.com/keys/microsoft.asc && \ + echo $'[azure-cli] \n\ +name=Azure CLI \n\ +baseurl=https://packages.microsoft.com/yumrepos/azure-cli \n\ +enabled=1 \n\ +gpgcheck=1 \n\ +gpgkey=https://packages.microsoft.com/keys/microsoft.asc' > /etc/yum.repos.d/azure-cli.repo && \ + yum install -y ${AZ_CLI} && \ + yum clean all || : ## aws_cli RUN if [ -n "${AWS_CLI_VERSION}" ] && [ "${AWS_CLI_VERSION}" != "latest" ]; then AWS_CLI="awscli==${AWS_CLI_VERSION}";fi && \ From 54b3c515b2998be481ca96de78187cb581197295 Mon Sep 17 00:00:00 2001 From: mima Date: Wed, 12 May 2021 12:53:29 +0200 Subject: [PATCH 2/2] fix delimiter --- Dockerfile.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.template b/Dockerfile.template index f1f7d6f..408081c 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -98,7 +98,7 @@ RUN if [ -n "${TERRAFORM_VERSION}" ] && [ "${TERRAFORM_VERSION}" != "latest" ]; terraform -install-autocomplete || : ## az_cli -RUN if [ -n "${AZ_CLI_VERSION}" ] && [ "${AZ_CLI_VERSION}" != "latest" ]; then AZ_CLI="azure-cli==${AZ_CLI_VERSION}";fi && \ +RUN if [ -n "${AZ_CLI_VERSION}" ] && [ "${AZ_CLI_VERSION}" != "latest" ]; then AZ_CLI="azure-cli-${AZ_CLI_VERSION}";fi && \ if [ "${AZ_CLI_VERSION}" == "latest" ]; then AZ_CLI="azure-cli";fi && \ test -n "${AZ_CLI_VERSION}" && \ rpm --import https://packages.microsoft.com/keys/microsoft.asc && \