forked from backube/volsync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (43 loc) · 1.92 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
FROM registry.access.redhat.com/ubi9-minimal
# Separate install for rsync is to install it w/ docs so that we get the rrsync
# command
RUN microdnf --refresh update -y && \
microdnf --nodocs --setopt=install_weak_deps=0 install -y \
bash \
openssh-clients \
openssh-server \
perl \
&& microdnf --setopt=install_weak_deps=0 install -y \
rsync \
&& microdnf clean all
COPY source.sh \
destination.sh \
destination-command.sh \
/
RUN chmod a+rx /source.sh /destination.sh \destination-command.sh && \
ln -s /keys/destination /etc/ssh/ssh_host_rsa_key && \
ln -s /keys/destination.pub /etc/ssh/ssh_host_rsa_key.pub && \
install /usr/share/doc/rsync/support/rrsync /usr/local/bin && \
\
SSHD_CONFIG="/etc/ssh/sshd_config" && \
sed -ir 's|^[#\s]*\(.*/etc/ssh/ssh_host_ecdsa_key\)$|#\1|' "$SSHD_CONFIG" && \
sed -ir 's|^[#\s]*\(.*/etc/ssh/ssh_host_ed25519_key\)$|#\1|' "$SSHD_CONFIG" && \
sed -ir 's|^[#\s]*\(PasswordAuthentication\)\s.*$|\1 no|' "$SSHD_CONFIG" && \
sed -ir 's|^[#\s]*\(GSSAPIAuthentication\)\s.*$|\1 no|' "$SSHD_CONFIG" && \
sed -ir 's|^[#\s]*\(AllowTcpForwarding\)\s.*$|\1 no|' "$SSHD_CONFIG" && \
sed -ir 's|^[#\s]*\(X11Forwarding\)\s.*$|\1 no|' "$SSHD_CONFIG" && \
sed -ir 's|^[#\s]*\(PermitTunnel\)\s.*$|\1 no|' "$SSHD_CONFIG"
ARG builddate_arg="(unknown)"
ARG version_arg="(unknown)"
ENV builddate="${builddate_arg}"
ENV version="${version_arg}"
LABEL org.label-schema.build-date="${builddate}" \
org.label-schema.description="rsync-based data mover for VolSync" \
org.label-schema.license="AGPL v3" \
org.label-schema.name="volsync-mover-rsync" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-ref="${version}" \
org.label-schema.vcs-url="https://github.com/backube/volsync" \
org.label-schema.vendor="Backube" \
org.label-schema.version="${version}"
ENTRYPOINT [ "/bin/bash" ]