aboutsummaryrefslogtreecommitdiff
path: root/src/docker-in-docker/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/docker-in-docker/install.sh')
-rwxr-xr-xsrc/docker-in-docker/install.sh17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh
index 477b7a4..a67aaba 100755
--- a/src/docker-in-docker/install.sh
+++ b/src/docker-in-docker/install.sh
@@ -69,21 +69,16 @@ get_common_setting() {
echo "$1=${!1}"
}
-# Function to run apt-get if needed
-apt_get_update_if_needed()
+apt_get_update()
{
- if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
- echo "Running apt-get update..."
- apt-get update
- else
- echo "Skipping apt-get update."
- fi
+ echo "Running apt-get update..."
+ apt-get update -y
}
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" > /dev/null 2>&1; then
- apt_get_update_if_needed
+ apt_get_update
apt-get -y install --no-install-recommends "$@"
fi
}
@@ -158,7 +153,7 @@ fi
# Install dependencies
check_packages apt-transport-https curl ca-certificates pigz iptables gnupg2 dirmngr
if ! type git > /dev/null 2>&1; then
- apt_get_update_if_needed
+ apt_get_update
apt-get -y install git
fi
@@ -254,7 +249,7 @@ else
if [ "${target_compose_arch}" != "x86_64" ]; then
# Use pip to get a version that runs on this architecture
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
- apt_get_update_if_needed
+ apt_get_update
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
fi
export PIPX_HOME=/usr/local/pipx