Skip to content

Commit 5f52c83

Browse files
authored
{Packaging} Optimize Linux package and docker image by trimming SDK (#26172)
1 parent 763e039 commit 5f52c83

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ COPY . /azure-cli
5252

5353
# 1. Build packages and store in tmp dir
5454
# 2. Install the cli and the other command modules that weren't included
55-
RUN ./scripts/install_full.sh \
55+
RUN ./scripts/install_full.sh && python ./scripts/trim_sdk.py \
5656
&& cat /azure-cli/az.completion > ~/.bashrc \
5757
&& runDeps="$( \
5858
scanelf --needed --nobanner --recursive /usr/local \

scripts/release/debian/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export PATH=$PATH:$WORKDIR/python_env/bin
5252

5353
find ${WORKDIR}/src/ -name setup.py -type f | xargs -I {} dirname {} | grep -v azure-cli-testsdk | xargs pip3 install --no-deps
5454
pip3 install -r ${WORKDIR}/src/azure-cli/requirements.py3.$(uname).txt
55+
$WORKDIR/python_env/bin/python3 ${WORKDIR}/scripts/trim_sdk.py
5556

5657
# Create create directory for debian build
5758
mkdir -p $WORKDIR/debian

scripts/release/rpm/azure-cli.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ A great cloud needs great tools; we're excited to introduce Azure CLI,
4848
source %{buildroot}%{cli_lib_dir}/bin/activate
4949
%{python_cmd} -m pip install --upgrade pip setuptools
5050
source %{repo_path}/scripts/install_full.sh
51+
# Remove unused SDK version
52+
%{python_cmd} %{repo_path}/scripts/trim_sdk.py
5153

5254
# cffi 1.15.0 doesn't work with RPM: https://foss.heptapod.net/pypy/cffi/-/issues/513
5355
%{python_cmd} -m pip install cffi==1.14.6

0 commit comments

Comments
 (0)