Added --no-install-recommends by default

This commit is contained in:
Steve Kamerman
2017-10-17 16:39:19 -04:00
committed by Kingdon Barrett
parent fcc1283c85
commit c41f837f82
2 changed files with 12 additions and 5 deletions

View File

@@ -1,10 +1,17 @@
#!/bin/sh
#!/bin/bash -e
# Apt installer helper for Docker images
set -e
ARGS="$*"
NO_RECOMMENDS="--no-install-recommends"
RECOMMENDS="--install-recommends"
if [[ $ARGS =~ "$RECOMMENDS" ]]; then
NO_RECOMMENDS=""
ARGS=$(sed "s/$RECOMMENDS//g" <<<"$ARGS")
fi
echo "Installing $*"
apt-get -q update && apt-get -qy install $* \
echo "Installing $ARGS"
apt-get -q update && apt-get -qy install $NO_RECOMMENDS $ARGS \
&& apt-get -qy autoremove \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*