-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (21 loc) · 1.02 KB
/
Dockerfile
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
FROM gcr.io/etcd-development/etcd:v3.5.16 as etcd
FROM alpine:3.21.2 as builder
RUN apk add --no-cache wget
RUN wget https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux -O /usr/local/bin/b2 && \
chmod +x /usr/local/bin/b2
FROM alpine:3.21.2
LABEL maintainer="Sonic <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/justereseau/omni_etcd_backup
LABEL org.opencontainers.image.description="This is a simple image that contain the requirement to backup an etcd omni instance to B2."
LABEL org.opencontainers.image.licenses=WTFPL
# Copy required binaries from etcd image
COPY --from=etcd /usr/local/bin/etcdctl /usr/local/bin/etcdctl
COPY --from=etcd /usr/local/bin/etcdutl /usr/local/bin/etcdutl
COPY --from=builder /usr/local/bin/b2 /usr/local/bin/b2
RUN apk add --no-cache bash gnupg xz
RUN mkdir /scripts
COPY backup.sh /scripts/backup.sh
RUN chmod +x /scripts/backup.sh
COPY restore.sh /scripts/restore.sh
RUN chmod +x /scripts/restore.sh
ENTRYPOINT [ "/scripts/backup.sh" ]