From fbb0a0983d65761d39a2511dc0f778a17ed44d39 Mon Sep 17 00:00:00 2001 From: Karol Lassak Date: Tue, 17 Oct 2023 11:13:17 +0200 Subject: [PATCH 1/3] Clean apt after install --- install-dind.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/install-dind.sh b/install-dind.sh index b1d0a69..20deaba 100755 --- a/install-dind.sh +++ b/install-dind.sh @@ -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 @@ -167,3 +186,5 @@ if ! detect_docker_compose; then else print_debug "docker-compose already installed" fi + +clean_after_install \ No newline at end of file From 2fd6bf3ff339be9cc5645254e7cf4f1b774165ed Mon Sep 17 00:00:00 2001 From: Karol Lassak Date: Tue, 17 Oct 2023 11:23:51 +0200 Subject: [PATCH 2/3] I hate bash --- install-dind.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-dind.sh b/install-dind.sh index 20deaba..e3c8a7b 100755 --- a/install-dind.sh +++ b/install-dind.sh @@ -142,7 +142,7 @@ install_jq() { } clean_after_install_debian_like() { - if [ "$apt_update_done" == "true" ]; then + if [ "$apt_update_done" = "true" ]; then echo "Cleaning apt after installs" apt-get clean rm -rf /var/lib/apt/lists/* From 669e2be650562e2a2d2a3a726fd4891761900568 Mon Sep 17 00:00:00 2001 From: Karol Lassak Date: Tue, 17 Oct 2023 11:41:18 +0200 Subject: [PATCH 3/3] Newline --- install-dind.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-dind.sh b/install-dind.sh index e3c8a7b..d5e6238 100755 --- a/install-dind.sh +++ b/install-dind.sh @@ -187,4 +187,4 @@ else print_debug "docker-compose already installed" fi -clean_after_install \ No newline at end of file +clean_after_install