Azure / Azure/azure-cli

install latest version of mgmt package only.

Open
#25,251 1 comment 1 reaction 1 assignee Claimed by @jiasli View on GitHub
act-platform-engineering-squad Auto-Assign Azure CLI Team customer-reported feature-request Installation
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

I found the current installation for Azure-CLI could be huge space used in https://github.com/Azure/azure-cli/issues/19591

When more versions to be added later, the package size could be bigger.

**Related command**

```
$ cd /azure-cli/2.44.1/libexec/lib/python3.10/site-packages/azure
$ du -sk * |sort -n|tail -2
44368 cli
498384 mgmt
```
So mgmt takes most space for the package azure-cli

```
$ cd mgmt/network

$ ls -l
...
drwxr-xr-x 11 bill admin 352 11 Jan 02:31 v2020_06_01
drwxr-xr-x 11 bill admin 352 11 Jan 02:31 v2020_07_01
drwxr-xr-x 11 bill admin 352 11 Jan 02:31 v2020_08_01
drwxr-xr-x 11 bill admin 352 11 Jan 02:31 v2020_11_01
drwxr-xr-x 11 bill admin 352 11 Jan 02:31 v2021_02_01
drwxr-xr-x 12 bill admin 384 18 Jan 11:20 v2021_02_01_preview
drwxr-xr-x 12 bill admin 384 18 Jan 11:20 v2022_01_01

$ ls -ld v* |wc -l
33
```

So the packages are installed 33 times for all versions for **mgmt**.

It is only for normal installation, but it makes the size of docker image `mcr.microsoft.com/azure-cli` to huge (1.35GB)

```
mcr.microsoft.com/azure-cli latest ba903d03e1cd 6 weeks ago 1.35GB
```

Are there any options or parameters I can use to only install the latest version in mgmt for production installation?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.