From 13218b395ea3e3de6817392dc3232f6bc909b954 Mon Sep 17 00:00:00 2001 From: Mirco Date: Thu, 21 Dec 2023 19:56:34 +0100 Subject: [PATCH] Improvements docker image building --- infrastructure/backup/image/Dockerfile | 2 +- .../backup/image/resources/install.sh | 24 ++++++++++++------- infrastructure/backup/test/Dockerfile | 11 --------- 3 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 infrastructure/backup/test/Dockerfile diff --git a/infrastructure/backup/image/Dockerfile b/infrastructure/backup/image/Dockerfile index a58ad24..e6e11b4 100644 --- a/infrastructure/backup/image/Dockerfile +++ b/infrastructure/backup/image/Dockerfile @@ -1,4 +1,4 @@ -FROM domaindrivenarchitecture/dda-backup:1.0.10 +FROM domaindrivenarchitecture/dda-backup:latest # Prepare Entrypoint Script ADD resources /tmp diff --git a/infrastructure/backup/image/resources/install.sh b/infrastructure/backup/image/resources/install.sh index b366fbf..f9c0484 100755 --- a/infrastructure/backup/image/resources/install.sh +++ b/infrastructure/backup/image/resources/install.sh @@ -1,13 +1,21 @@ #!/bin/bash -set -eux pipefail +set -exo pipefail -apt-get update > /dev/null; +function main() +{ + { + install -m 0700 /tmp/entrypoint.sh / + install -m 0700 /tmp/entrypoint-start-and-wait.sh / -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/restic-snapshots.sh /usr/local/bin/ + + cleanupDocker + } > /dev/null +} -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/restic-snapshots.sh /usr/local/bin/ +source /tmp/install_functions_debian.sh +DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes main diff --git a/infrastructure/backup/test/Dockerfile b/infrastructure/backup/test/Dockerfile deleted file mode 100644 index 667bca5..0000000 --- a/infrastructure/backup/test/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM c4k-taiga-backup - -RUN apt update -RUN apt -yqq --no-install-recommends --yes install curl default-jre-headless - -RUN curl -L -o /tmp/serverspec.jar \ - https://github.com/DomainDrivenArchitecture/dda-serverspec-crate/releases/download/2.0.0/dda-serverspec-standalone.jar - -COPY serverspec.edn /tmp/serverspec.edn - -RUN java -jar /tmp/serverspec.jar /tmp/serverspec.edn -v \ No newline at end of file