Skip to content

Commit

Permalink
Clean apt after install (#17)
Browse files Browse the repository at this point in the history
* Clean apt after install
  • Loading branch information
ingwarsw authored Oct 17, 2023
1 parent 0b9edb9 commit 72ce504
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions install-dind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ install_jq() {
esac
}

clean_after_install_debian_like() {
if [ "$apt_update_done" = "true" ]; then
echo "Cleaning apt after installs"
apt-get clean
rm -rf /var/lib/apt/lists/*
fi
}

clean_after_install() {
case "$distro" in
alpine | amzn)
# nothing to clean
;;
*)
clean_after_install_debian_like
;;
esac
}

if [ "$(id -u)" != 0 ]; then
echo "Warning: Docker-in-Earthly needs to be run as root user"
fi
Expand All @@ -167,3 +186,5 @@ if ! detect_docker_compose; then
else
print_debug "docker-compose already installed"
fi

clean_after_install

0 comments on commit 72ce504

Please sign in to comment.