diff --git a/Dockerfile b/Dockerfile index 108d55b8bdb..37374bba5aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ diff --git a/scripts/release/debian/build.sh b/scripts/release/debian/build.sh index 0141ee89e07..f6471251312 100755 --- a/scripts/release/debian/build.sh +++ b/scripts/release/debian/build.sh @@ -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 diff --git a/scripts/release/rpm/azure-cli.spec b/scripts/release/rpm/azure-cli.spec index b97be2b0a8a..e63f58f7be6 100644 --- a/scripts/release/rpm/azure-cli.spec +++ b/scripts/release/rpm/azure-cli.spec @@ -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