aboutsummaryrefslogtreecommitdiff
path: root/src/azure-cli
diff options
context:
space:
mode:
Diffstat (limited to 'src/azure-cli')
-rw-r--r--src/azure-cli/devcontainer-feature.json2
-rwxr-xr-xsrc/azure-cli/install.sh13
2 files changed, 12 insertions, 3 deletions
diff --git a/src/azure-cli/devcontainer-feature.json b/src/azure-cli/devcontainer-feature.json
index b3e6288..85fa055 100644
--- a/src/azure-cli/devcontainer-feature.json
+++ b/src/azure-cli/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "azure-cli",
- "version": "1.0.3",
+ "version": "1.0.4",
"name": "Azure CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/azure-cli",
"description": "Installs the Azure CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
diff --git a/src/azure-cli/install.sh b/src/azure-cli/install.sh
index 6518f6c..de5d65d 100755
--- a/src/azure-cli/install.sh
+++ b/src/azure-cli/install.sh
@@ -9,6 +9,9 @@
set -e
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
AZ_VERSION=${VERSION:-"latest"}
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
@@ -44,7 +47,10 @@ apt_get_update()
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
- apt_get_update
+ if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
+ echo "Running apt-get update..."
+ apt-get update -y
+ fi
apt-get -y install --no-install-recommends "$@"
fi
}
@@ -179,4 +185,7 @@ if [ "${use_pip}" = "true" ]; then
fi
fi
-echo "Done!" \ No newline at end of file
+# Clean up
+rm -rf /var/lib/apt/lists/*
+
+echo "Done!"