Skip to content

Commit 51d3371

Browse files
authored
{Packaging} Accelerate command execution in Docker image with warm start (Azure#30643)
1 parent cfdd921 commit 51d3371

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

azure-linux.dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ FROM $IMAGE
88

99
# 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
1010
# 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
11-
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
11+
RUN --mount=type=bind,target=/azure-cli.rpm,source=./docker-temp/azure-cli.rpm \
12+
tdnf install ca-certificates jq /azure-cli.rpm -y && \
13+
# Run az version to generate the commandIndex.json and speed up the following az commands
14+
az version && cd ~/.azure && ls | grep --invert-match commandIndex.json | xargs rm -rf && \
15+
tdnf clean all && rm -rf /var/cache/tdnf
1216

1317
# See https://github.com/Azure/azure-cli/issues/29828 for background on this
1418
ENV AZ_BICEP_GLOBALIZATION_INVARIANT=1

0 commit comments

Comments
 (0)