-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (58 loc) · 2.87 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (58 loc) · 2.87 KB
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
# Use an official Ubuntu runtime as a parent image
FROM ubuntu:24.04@sha256:4fbb8e6a8395de5a7550b33509421a2bafbc0aab6c06ba2cef9ebffbc7092d90
# renovate: datasource=github-tags depName=aws/aws-cli
ARG VERSION_AWS_CLI=2.35.15
# renovate: datasource=github-tags depName=cli/cli
ARG VERSION_GH_CLI=2.96.0
# renovate: datasource=github-tags depName=openbao/openbao
ARG VERSION_OPENBAO=2.5.5
# renovate: datasource=github-tags depName=grafana/loki
ARG VERSION_LOKI=3.7.2
# renovate: datasource=github-releases depName=restic/restic
ARG VERSION_RESTIC=0.19.1
# Update the system and install required packages
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y curl unzip bzip2 groff-base less gnupg2 git jq tmux && \
rm -rf /var/lib/apt/lists/*
# Install loki's logcli
RUN curl --proto =https -L -o logcli-linux-amd64.zip https://github.com/grafana/loki/releases/download/v${VERSION_LOKI}/logcli-linux-amd64.zip \
&& unzip logcli-linux-amd64.zip \
&& mv logcli-linux-amd64 /usr/bin/logcli \
&& rm logcli-linux-amd64.zip
# Install specific AWS CLI version
RUN curl --proto =https "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${VERSION_AWS_CLI}.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip aws
# renovate: datasource=github-tags depName=openbao/openbao
ARG VERSION_OPENBAO=2.5.5
#Download and install Bao
ADD https://github.com/openbao/openbao/releases/download/v${VERSION_OPENBAO}/bao_${VERSION_OPENBAO}_Linux_x86_64.tar.gz /tmp/bao_${VERSION_OPENBAO}_Linux_x86_64.tar.gz
# Unzip the Bao binary and clean up
RUN tar -xzvf /tmp/bao_${VERSION_OPENBAO}_Linux_x86_64.tar.gz bao && mv bao /usr/local/bin/bao && \
rm /tmp/bao_${VERSION_OPENBAO}_Linux_x86_64.tar.gz
# Install GitHub CLI
RUN curl --proto =https -LO https://github.com/cli/cli/releases/download/v${VERSION_GH_CLI}/gh_${VERSION_GH_CLI}_linux_amd64.deb && \
dpkg -i gh_${VERSION_GH_CLI}_linux_amd64.deb && \
rm gh_${VERSION_GH_CLI}_linux_amd64.deb
# Install restic (single static binary, shipped bzip2-compressed)
RUN curl --proto =https -fsSL -o /tmp/restic.bz2 \
"https://github.com/restic/restic/releases/download/v${VERSION_RESTIC}/restic_${VERSION_RESTIC}_linux_amd64.bz2" && \
bunzip2 -c /tmp/restic.bz2 > /usr/local/bin/restic && \
chmod 0755 /usr/local/bin/restic && \
rm -f /tmp/restic.bz2 && \
restic version
# Set working directory in the container
RUN mkdir /app
ADD github-backup.sh /usr/bin/backup-github
ADD vault-backup.sh /usr/bin/backup-vault
ADD s3-backup.sh /usr/bin/s3-backup
ADD nfs-backup.sh /usr/bin/backup-nfs
ADD nfs-restore.sh /usr/bin/restore-nfs
ADD restic-common.sh /usr/lib/backup-tools/restic-common.sh
RUN chmod 0755 /usr/bin/backup-nfs /usr/bin/restore-nfs && \
chmod 0644 /usr/lib/backup-tools/restic-common.sh
ENV CACHED_VERSION_OPENBAO=${VERSION_OPENBAO}
WORKDIR /app
CMD ["bash"]