Skip to content

Commit

Permalink
{Packaging} Optimize Linux package and docker image by trimming SDK (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
bebound committed Apr 19, 2023
1 parent 510ab43 commit 4190100
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ COPY . /azure-cli

# 1. Build packages and store in tmp dir
# 2. Install the cli and the other command modules that weren't included
RUN ./scripts/install_full.sh \
RUN ./scripts/install_full.sh && python ./scripts/trim_sdk.py \
&& cat /azure-cli/az.completion > ~/.bashrc \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
Expand Down
1 change: 1 addition & 0 deletions scripts/release/debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export PATH=$PATH:$WORKDIR/python_env/bin

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

# Create create directory for debian build
mkdir -p $WORKDIR/debian
Expand Down
2 changes: 2 additions & 0 deletions scripts/release/rpm/azure-cli.spec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ A great cloud needs great tools; we're excited to introduce Azure CLI,
source %{buildroot}%{cli_lib_dir}/bin/activate
%{python_cmd} -m pip install --upgrade pip setuptools
source %{repo_path}/scripts/install_full.sh
# Remove unused SDK version
%{python_cmd} %{repo_path}/scripts/trim_sdk.py

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

0 comments on commit 4190100

Please sign in to comment.