From 334df889eb31dedda8c65234a7616dd7133a8703 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Mon, 13 Jan 2025 10:52:15 +0800 Subject: [PATCH 1/3] Init --- azure-linux.dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-linux.dockerfile b/azure-linux.dockerfile index 03631d5f350..fc9dc3c7c84 100644 --- a/azure-linux.dockerfile +++ b/azure-linux.dockerfile @@ -8,7 +8,8 @@ FROM $IMAGE # ca-certificates: Azure Linux base image does not contain Mozilla CA certificates, install it to prevent CERTIFICATE_VERIFY_FAILED errors, see https://github.com/Azure/azure-cli/issues/26026 # jq: It's widely used for parsing JSON output in Azure CLI and has a small size. See https://github.com/Azure/azure-cli/issues/29830 -RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm tdnf install ca-certificates jq /azure-cli.rpm -y && tdnf clean all && rm -rf /var/cache/tdnf +# Run az version to generate the command index and speed up the following az commands +RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm tdnf install ca-certificates jq /azure-cli.rpm -y && az version && tdnf clean all && rm -rf /var/cache/tdnf # See https://github.com/Azure/azure-cli/issues/29828 for background on this ENV AZ_BICEP_GLOBALIZATION_INVARIANT=1 From 35ef27901d78f6a4778da4036df4a98d78120fb7 Mon Sep 17 00:00:00 2001 From: Hang Lei Date: Thu, 16 Jan 2025 10:45:40 +0800 Subject: [PATCH 2/3] Remove useless files --- azure-linux.dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/azure-linux.dockerfile b/azure-linux.dockerfile index fc9dc3c7c84..a442095f0e2 100644 --- a/azure-linux.dockerfile +++ b/azure-linux.dockerfile @@ -8,8 +8,11 @@ FROM $IMAGE # ca-certificates: Azure Linux base image does not contain Mozilla CA certificates, install it to prevent CERTIFICATE_VERIFY_FAILED errors, see https://github.com/Azure/azure-cli/issues/26026 # jq: It's widely used for parsing JSON output in Azure CLI and has a small size. See https://github.com/Azure/azure-cli/issues/29830 -# Run az version to generate the command index and speed up the following az commands -RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm tdnf install ca-certificates jq /azure-cli.rpm -y && az version && tdnf clean all && rm -rf /var/cache/tdnf +RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm \ + tdnf install ca-certificates jq /azure-cli.rpm -y && \ + # Run az version to generate the commandIndex.json and speed up the following az commands + az version && cd ~/.azure && ls | grep -v commandIndex.json | xargs rm -rf && \ + tdnf clean all && rm -rf /var/cache/tdnf # See https://github.com/Azure/azure-cli/issues/29828 for background on this ENV AZ_BICEP_GLOBALIZATION_INVARIANT=1 From f558d46f8a2212c6acd3446a15ef71785f6d03e5 Mon Sep 17 00:00:00 2001 From: Hang Date: Mon, 20 Jan 2025 16:48:55 +0800 Subject: [PATCH 3/3] Update azure-linux.dockerfile Co-authored-by: Jiashuo Li <4003950+jiasli@users.noreply.github.com> --- azure-linux.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-linux.dockerfile b/azure-linux.dockerfile index a442095f0e2..974103d16cd 100644 --- a/azure-linux.dockerfile +++ b/azure-linux.dockerfile @@ -11,7 +11,7 @@ FROM $IMAGE RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm \ tdnf install ca-certificates jq /azure-cli.rpm -y && \ # Run az version to generate the commandIndex.json and speed up the following az commands - az version && cd ~/.azure && ls | grep -v commandIndex.json | xargs rm -rf && \ + az version && cd ~/.azure && ls | grep --invert-match commandIndex.json | xargs rm -rf && \ tdnf clean all && rm -rf /var/cache/tdnf # See https://github.com/Azure/azure-cli/issues/29828 for background on this