From afdbdc04ea32dd13dd5673e9f6b894259bc69012 Mon Sep 17 00:00:00 2001 From: Alex Thomae Date: Sun, 1 Nov 2020 07:10:03 +0100 Subject: [PATCH] Reorganize the code and switch to debian:stable-slim --- .gitlab-ci.yml | 2 ++ Dockerfile | 32 +++++++++++----------- LICENSE | 2 +- src/mariadb-backup.sh => mariadb-backup.sh | 0 4 files changed, 19 insertions(+), 17 deletions(-) rename src/mariadb-backup.sh => mariadb-backup.sh (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27f711a..8b367cf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,10 @@ +--- variables: DOCKERHUB_REPO_NAME: mariadb-backup ENABLE_ARM64: 'true' ENABLE_ARMv7: 'true' ENABLE_ARMv6: 'true' + ENABLE_i386: 'true' include: - project: 'ix.ai/ci-templates' diff --git a/Dockerfile b/Dockerfile index 37e768d..cf08569 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,25 @@ -FROM debian:buster +FROM debian:stable-slim LABEL maintainer="docker@ix.ai" \ ai.ix.repository="ix.ai/mariadb-backup" -ENV DEBIAN_FRONTEND=noninteractive TERM=linux - -COPY src/ /app +VOLUME ["/backup"] +WORKDIR /backup -RUN chmod 755 /app/*.sh && \ - groupadd -g 666 mybackup && \ - useradd -u 666 -g 666 -d /backup -c "MariaDB Backup User" mybackup && \ - apt-get update && \ - apt-get -y dist-upgrade && \ - apt-get install -y mydumper && \ - apt-get -y --purge autoremove && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ +RUN set -xeu; \ + export DEBIAN_FRONTEND=noninteractive; \ + export TERM=linux; \ + groupadd -g 666 mybackup; \ + useradd -u 666 -g 666 -d /backup -c "MariaDB Backup User" mybackup; \ + apt-get update; \ + apt-get -y dist-upgrade; \ + apt-get install -y mydumper; \ + apt-get -y --purge autoremove; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/*; \ find /var/log -type f | while read f; do echo -ne '' > $f; done; -VOLUME ["/backup"] -WORKDIR /backup +COPY mariadb-backup.sh /usr/local/bin/mariadb-backup ENV DB_PORT=3306 DB_USER=root -ENTRYPOINT ["/app/mariadb-backup.sh"] +ENTRYPOINT ["/usr/local/bin/mariadb-backup"] diff --git a/LICENSE b/LICENSE index 9990555..f3eff7a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Namshi +Copyright (c) 2018 Namshi, ix.ai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/mariadb-backup.sh b/mariadb-backup.sh similarity index 100% rename from src/mariadb-backup.sh rename to mariadb-backup.sh