install latest version of mgmt package only.
- 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
Assessment
This issue has not been assessed yet.