From 2771fed34100b0e2da54865bb427a37d97307122 Mon Sep 17 00:00:00 2001 From: Mirco Date: Thu, 21 Dec 2023 20:13:30 +0100 Subject: [PATCH] Improvements docker image building --- .gitlab-ci.yml | 6 ++--- infrastructure/backup/image/Dockerfile | 2 +- .../backup/image/resources/install.sh | 24 ++++++++++++------- infrastructure/nextcloud/image/Dockerfile | 2 +- .../nextcloud/image/resources/entrypoint.sh | 2 +- .../nextcloud/image/resources/install.sh | 4 ++-- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c989a65..a602384 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ stages: #- integrationtest .img: &img - image: "domaindrivenarchitecture/ddadevops-dind:4.10.0" + image: "domaindrivenarchitecture/ddadevops-dind:4.10.5" services: - docker:dind before_script: @@ -17,7 +17,7 @@ stages: - export IMAGE_TAG=$CI_COMMIT_TAG .cljs-job: &cljs - image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.0" + image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.5" cache: key: ${CI_COMMIT_REF_SLUG} paths: @@ -30,7 +30,7 @@ stages: - npm install .clj-job: &clj - image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.0" + image: "domaindrivenarchitecture/ddadevops-clj-cljs:4.10.5" cache: key: ${CI_COMMIT_REF_SLUG} paths: diff --git a/infrastructure/backup/image/Dockerfile b/infrastructure/backup/image/Dockerfile index b31010f..e6e11b4 100644 --- a/infrastructure/backup/image/Dockerfile +++ b/infrastructure/backup/image/Dockerfile @@ -2,4 +2,4 @@ FROM domaindrivenarchitecture/dda-backup:latest # Prepare Entrypoint Script ADD resources /tmp -RUN DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes /tmp/install.sh +RUN /tmp/install.sh diff --git a/infrastructure/backup/image/resources/install.sh b/infrastructure/backup/image/resources/install.sh index 35ab462..1ebd786 100755 --- a/infrastructure/backup/image/resources/install.sh +++ b/infrastructure/backup/image/resources/install.sh @@ -2,12 +2,20 @@ set -exo pipefail -install -m 0700 /tmp/entrypoint.sh / -install -m 0700 /tmp/entrypoint-start-and-wait.sh / +function main() { + { + install -m 0700 /tmp/entrypoint.sh / + install -m 0700 /tmp/entrypoint-start-and-wait.sh / -install -m 0700 /tmp/init.sh /usr/local/bin/ -install -m 0700 /tmp/backup.sh /usr/local/bin/ -install -m 0700 /tmp/restore.sh /usr/local/bin/ -install -m 0700 /tmp/list-snapshots.sh /usr/local/bin/ -install -m 0700 /tmp/start-maintenance.sh /usr/local/bin/ -install -m 0700 /tmp/end-maintenance.sh /usr/local/bin/ + install -m 0700 /tmp/init.sh /usr/local/bin/ + install -m 0700 /tmp/backup.sh /usr/local/bin/ + install -m 0700 /tmp/restore.sh /usr/local/bin/ + install -m 0700 /tmp/list-snapshots.sh /usr/local/bin/ + install -m 0700 /tmp/start-maintenance.sh /usr/local/bin/ + install -m 0700 /tmp/end-maintenance.sh /usr/local/bin/ + cleanupDocker + } > /dev/null +} + +source /tmp/install_functions_debian.sh +main diff --git a/infrastructure/nextcloud/image/Dockerfile b/infrastructure/nextcloud/image/Dockerfile index 8279683..a94a71e 100644 --- a/infrastructure/nextcloud/image/Dockerfile +++ b/infrastructure/nextcloud/image/Dockerfile @@ -2,7 +2,7 @@ FROM nextcloud:27 # Prepare Entrypoint Script ADD resources /tmp -RUN DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes /tmp/install.sh +RUN /tmp/install.sh ENTRYPOINT ["/entrypoint.sh"] CMD ["apache2-foreground"] diff --git a/infrastructure/nextcloud/image/resources/entrypoint.sh b/infrastructure/nextcloud/image/resources/entrypoint.sh index 51ea448..305112a 100644 --- a/infrastructure/nextcloud/image/resources/entrypoint.sh +++ b/infrastructure/nextcloud/image/resources/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -eux pipefail +set -exo pipefail # version_greater A B returns whether A > B version_greater() { diff --git a/infrastructure/nextcloud/image/resources/install.sh b/infrastructure/nextcloud/image/resources/install.sh index 1a37e42..b9595d4 100755 --- a/infrastructure/nextcloud/image/resources/install.sh +++ b/infrastructure/nextcloud/image/resources/install.sh @@ -16,5 +16,5 @@ function main() { cleanupDocker } -source /tmp/install_functions.sh -main \ No newline at end of file +source /tmp/install_functions_debian.sh +DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main \ No newline at end of file