Files

62 lines
2.2 KiB
Docker
Raw Permalink Normal View History

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"
ENV INTERACTIVE_MODE="false"
ENV RUN_INSTALL_SCRIPT="false"
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 /
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/
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
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
# 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'
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" ]