-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (51 loc) · 2.01 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
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
FROM golang:1.19
ARG RESTIC_COMMIT="f0bb4f8708b1e09e09897463d70b5c89b20eec01"
ENV PATH="$PATH:/opt/waiob/bin"
WORKDIR /build
RUN \
git init -b main && \
git remote add origin https://github.com/restic/restic && \
git fetch --depth 1 origin "$RESTIC_COMMIT" && \
git reset --hard FETCH_HEAD && \
unset GOPATH && \
go run build.go
#---
FROM debian:bullseye-slim
ENV PATH="${PATH}:/opt/waiob/bin"
ENV LANG en_US.UTF-8
RUN \
apt-get update && \
apt-get install -y --no-install-recommends locales && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8 && \
apt-get install -y --no-install-recommends \
jq \
wget \
gnupg \
restic \
ca-certificates \
&& \
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor &&\
wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null &&\
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C &&\
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list &&\
echo "deb http://repo.mysql.com/apt/debian/ bullseye mysql-8.0 mysql-tools" | tee /etc/apt/sources.list.d/mysql.list &&\
echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list &&\
apt-get update &&\
apt-get install -y --no-install-recommends \
mongodb-org-shell \
mongodb-org-tools \
mysql-community-client \
mysql-shell \
postgresql-client-16 \
&& \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=0 /build/restic /usr/local/bin/
COPY bin/waiob /opt/waiob/bin/waiob
COPY src /opt/waiob/src
RUN chmod +x /opt/waiob/bin/*
ENTRYPOINT [ "waiob" ]
CMD ["--help"]