-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile-base
138 lines (111 loc) · 4.31 KB
/
Dockerfile-base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
FROM ubuntu:20.04
# test mandatory args
ARG RELEASE_MAJOR
ARG RELEASE_MINOR
ARG RELEASE
RUN [ -n "${RELEASE}" ] && [ -n "${RELEASE_MAJOR}" ] && [ -n "${RELEASE_MINOR}" ]
# Image Label
LABEL maintainer="konvergence.com" \
website="https://www.konvergence.com" \
description="volume backup with duplicity using openstack swift, sftp or filesystem volume" \
release="${RELEASE}"
ENV GOPATH=/opt/go \
DEBIAN_FRONTEND=noninteractive
ARG JOBBER_VERSION="v1.4.4"
ARG DUPLICITY_RELEASE=2.2.2
RUN echo "#### add stable duplicity PPA https://code.launchpad.net/~duplicity-team/+archive/ubuntu/duplicity-release-git" \
&& apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository -y ppa:duplicity-team/duplicity-release-git \
&& echo "#### install needed packages for focal" \
&& apt-get update \
&& apt-get install -y --no-install-recommends apt-utils \
&& apt-get install -y tzdata \
gettext-base \
python3-swiftclient \
msmtp \
git curl golang-go \
jq \
&& echo "#### intall duplicity from stable PPA https://code.launchpad.net/~duplicity-team/+archive/ubuntu/duplicity-release-git" \
&& apt-get install -y python-pycryptopp python3-boto python3-dev \
&& apt-get install -y duplicity=2.2.2-ppa202402031636~ubuntu20.04.1 \
&& echo "#### install sftp/scp paramiko module" \
&& apt-get install -y python3-paramiko python-gobject-2 \
&& echo "#### install sftp/scp pexpect module" \
&& apt-get install -y openssh-client python-pexpect \
&& echo "#### install jobber" \
&& mkdir -p /opt/go \
&& apt-get install -y build-essential \
&& mkdir -p /opt/go/src/github.com/dshearer/jobber/ \
&& curl -sSL "https://github.com/dshearer/jobber/archive/${JOBBER_VERSION}.tar.gz" | tar -xz -C /opt/go/src/github.com/dshearer/jobber/ --strip-components=1 \
&& make --directory=/opt/go/src/github.com/dshearer/jobber \
&& echo "#### prepare jobber deamon" \
&& mkdir -p /opt/go/jobber \
&& cp /opt/go/src/github.com/dshearer/jobber/bin/* /opt/go/jobber \
&& cd /usr/local/bin/ \
&& ln -f -s /opt/go/jobber/jobber jobber \
&& mkdir -p /usr/local/lib/jobber \
&& rm -rf /opt/go/src/ \
&& echo "#### clean " \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
COPY assets/jobber/jobber.conf /etc/jobber.conf
# Add Tini
ARG TINI_VERSION="v0.19.0"
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# Add scripts
COPY assets/scripts/ /bin/
RUN chmod +x /bin/*.sh
# template of msmtprc config
COPY assets/msmtprc/ /usr/share/msmtprc/
# Readme and changelog
##COPY releases/${RELEASE}/USAGE.md releases/${RELEASE}/CHANGELOG.md /
COPY USAGE.md CHANGELOG.md /
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
RELEASE=${RELEASE} \
TZ=Europe/Paris \
DATA_FOLDER=/data \
EXCLUDE_PATHS="" \
VERBOSE=yes \
VERBOSE_PROGRESS=yes \
CLEAN_BEFORE_RESTORE=no \
DB_TYPE=none \
DB_DUMP_FILE=dumpall.out \
DB_COMPRESS_ENABLE=false \
DB_COMPRESS_LEVEL=4 \
FULL_MODE=false \
OS_AUTH_URL=https://auth.cloud.ovh.net/v3/ \
SWIFT_AUTHVERSION=3 \
OS_TENANT_ID=yourTenantID \
OS_TENANT_NAME=yourTenantName \
OS_USERNAME=yourUserName \
OS_PASSWORD=yourUserPassword \
BACKUP_VOLUME_SIZE=256 \
DAILY_JOB_HOUR="00 00 02" \
DAILY_BACKUP_FULL_DAY=0 \
DAILY_BACKUP_MAX_WEEK=5 \
DAILY_BACKUP_PREFIX=backup \
DAILY_OS_REGION_NAME=GRA \
MONTHLY_BACKUP_DAY=1 \
MONTHLY_BACKUP_PREFIX=archive \
MONTHLY_BACKUP_MAX_MONTH=12 \
MONTHLY_OS_REGION_NAME=SBG \
SFTP_MODULE=pexpect+sftp \
DB_SKIP_DROP=false \
DB_DATABASES=""
## PASSPHRASE=YourSuperPassPhrase \
## DAILY_BACKUP_MAX_FULL_WITH_INCR=0 \
## DAILY_BACKUP_MAX_FULL=0 \
## MONTHLY_BACKUP_MAX_FULL_WITH_INCR=0 \
## MONTHLY_BACKUP_MAX_FULL=0 \
## DAILY_FILESYSTEM_CONTAINER="/backup" \
## DAILY_SWIFT_CONTAINER="my-object-storage-gra3" \
## MONTHLY_FILESYSTEM_CONTAINER="/backup" \
## MONTHLY_SWIFT_CONTAINER="my-archive-storage-gra3"
# Metadata
VOLUME [ "${DATA_FOLDER}" ]
# Entrypoint and CMD
ENTRYPOINT ["/tini", "--", "bash", "/bin/entrypoint-init.sh" ]
CMD ["--help"]