2022-12-09 15:04:51 +01:00
|
|
|
FROM archlinux:latest
|
2021-12-30 01:12:33 +01:00
|
|
|
|
|
|
|
|
ENV USER=borg
|
|
|
|
|
ENV UID=1000
|
|
|
|
|
ENV GID=1000
|
2022-06-30 22:01:55 +02:00
|
|
|
ENV MAINTENANCE_ENABLE="false"
|
2022-07-01 18:47:48 +02:00
|
|
|
ENV INTERACTIVE_MODE="false"
|
2022-07-03 11:47:40 +02:00
|
|
|
ENV RUN_INSTALL_SCRIPT="false"
|
2022-11-02 11:06:16 +01:00
|
|
|
ENV RUN_PROMETHEUS_EXPORTER="false"
|
2022-07-01 08:09:18 +02:00
|
|
|
ENV TZ=""
|
2021-12-30 01:12:33 +01:00
|
|
|
|
|
|
|
|
# Add Folders and Shell Scripts
|
2021-12-30 03:32:06 +01:00
|
|
|
RUN mkdir "/.ssh"
|
|
|
|
|
VOLUME ["/backups"]
|
2022-06-30 22:01:55 +02:00
|
|
|
VOLUME ["/logs"]
|
2022-07-01 10:09:03 +02:00
|
|
|
VOLUME ["/sshkeys/host"]
|
|
|
|
|
|
2022-11-02 11:17:16 +01:00
|
|
|
COPY entrypoint-script/entrypoint.sh /
|
|
|
|
|
COPY entrypoint-script/variables.sh /
|
2022-11-25 20:13:08 +01:00
|
|
|
COPY scripts/borgbackup.sh /usr/local/bin/
|
2021-12-30 01:12:33 +01:00
|
|
|
|
2022-11-02 11:17:16 +01:00
|
|
|
COPY bash-config/.bash_profile /root/
|
2022-12-09 15:04:51 +01:00
|
|
|
COPY bash-config/.bashrc_root /root/
|
|
|
|
|
|
|
|
|
|
COPY bash-config/.bash_profile /
|
|
|
|
|
COPY bash-config/.bashrc /
|
2024-12-03 19:39:53 +01:00
|
|
|
COPY bash-config/locale.gen /etc/locale.gen
|
2022-07-01 14:42:12 +02:00
|
|
|
|
2022-11-02 11:06:16 +01:00
|
|
|
COPY prometheus-borg-exporter/borg_exporter.sh /usr/local/bin/
|
|
|
|
|
COPY prometheus-borg-exporter/borg_exporter.rc /etc/
|
|
|
|
|
|
2024-12-01 21:12:17 +01:00
|
|
|
# Create .cache folder
|
|
|
|
|
RUN mkdir -p "/root/.cache/crontab"
|
|
|
|
|
|
2024-12-03 19:39:53 +01:00
|
|
|
# Create locale files
|
|
|
|
|
RUN locale-gen
|
|
|
|
|
|
2021-12-30 01:12:33 +01:00
|
|
|
# Install packages
|
2022-12-16 14:43:12 +01:00
|
|
|
RUN pacman-key --init
|
2025-06-02 13:29:26 +02:00
|
|
|
RUN pacman -Syu --noconfirm sudo bash-completion openssh fastfetch \
|
2024-12-01 21:44:40 +01:00
|
|
|
borgbackup dateutils prometheus-node-exporter wget git base-devel cron net-tools inetutils tmux
|
2022-12-09 15:04:51 +01:00
|
|
|
|
|
|
|
|
# Make Build User
|
|
|
|
|
RUN useradd builduser -m
|
|
|
|
|
RUN passwd -d builduser
|
|
|
|
|
RUN printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers
|
2024-12-22 13:34:18 +01:00
|
|
|
RUN sudo -u builduser bash -c 'cd ~ && git clone https://aur.archlinux.org/teleport-bin.git teleport && cd teleport && makepkg -si --noconfirm && cd ~ && rm -rf teleport'
|
|
|
|
|
#RUN sudo -u builduser bash -c 'cd ~ && git clone https://git.yiprawr.dev/daniel156161/teleport-bin.git teleport && cd teleport && makepkg -si --noconfirm && cd ~ && rm -rf teleport'
|
2022-12-09 15:04:51 +01:00
|
|
|
RUN userdel -r builduser
|
2021-12-30 01:12:33 +01:00
|
|
|
|
|
|
|
|
# Setup SSH-Server
|
|
|
|
|
RUN sed -ie 's/#Port 22/Port 22/g' /etc/ssh/sshd_config
|
|
|
|
|
RUN sed -ie 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
|
|
|
|
RUN sed -ie 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
|
|
|
|
|
2021-12-30 03:32:06 +01:00
|
|
|
RUN sed -ie 's|#HostKey /etc/ssh/ssh_host_rsa_key|HostKey /sshkeys/host/ssh_host_rsa_key|g' /etc/ssh/sshd_config
|
|
|
|
|
RUN sed -ie 's|#HostKey /etc/ssh/ssh_host_ecdsa_key|HostKey /sshkeys/host/ssh_host_ecdsa_key|g' /etc/ssh/sshd_config
|
|
|
|
|
RUN sed -ie 's|#HostKey /etc/ssh/ssh_host_ed25519_key|HostKey /sshkeys/host/ssh_host_ed25519_key|g' /etc/ssh/sshd_config
|
|
|
|
|
|
2021-12-30 01:12:33 +01:00
|
|
|
EXPOSE 22
|
|
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ]
|