diff --git a/containers/debian/Dockerfile b/containers/debian/Dockerfile index e47121b..a7811ca 100644 --- a/containers/debian/Dockerfile +++ b/containers/debian/Dockerfile @@ -14,6 +14,7 @@ RUN apt-get update && apt-get upgrade -y && \ openssh-server \ openssl \ python3 \ + python3-venv \ sudo \ nano \ btop \ @@ -21,9 +22,20 @@ RUN apt-get update && apt-get upgrade -y && \ systemd-sysv \ dbus \ ifupdown \ + iputils-ping \ + dnsutils \ + unattended-upgrades \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# Add install scripts and make them executable +COPY install-docker.sh /usr/local/bin/install-docker +RUN chmod +x /usr/local/bin/install-docker +COPY install-incus.sh /usr/local/bin/install-incus +RUN chmod +x /usr/local/bin/install-incus + +RUN echo "Install scripts available with install-docker and install-incus, maybe more" > /root/README.txt + # Install Tailscale RUN curl -fsSL https://tailscale.com/install.sh | sh @@ -42,6 +54,7 @@ RUN mkdir -p /etc/apt/keyrings && \ # Configure Services RUN systemctl enable ssh RUN systemctl enable cron +RUN systemctl enable unattended-upgrades RUN systemctl enable incus-agent || true RUN systemctl enable tailscaled || true RUN ssh-keygen -A @@ -54,8 +67,11 @@ RUN mkdir -p /root/.ssh && \ chmod 600 /root/.ssh/authorized_keys && \ chmod 700 /root/.ssh +RUN mkdir -p /etc/docker && \ + printf '{\n "bip": "192.168.100.1/24"\n}\n' > /etc/docker/daemon.json + RUN printf 'root ALL=(ALL) NOPASSWD:ALL\n' > /etc/sudoers.d/00-root-nopasswd && \ - chmod 0440 /etc/sudoers.d/00-root-nopasswd + chmod 0440 /etc/sudoers.d/00-root-nopasswd EXPOSE 22 diff --git a/containers/debian/install-docker.sh b/containers/debian/install-docker.sh new file mode 100644 index 0000000..7cc5dc0 --- /dev/null +++ b/containers/debian/install-docker.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Update and install prerequisites +apt-get update + +# Install Docker packages +apt-get install -y docker.io docker-compose + +# Configure Docker daemon with specific IP range +mkdir -p /etc/docker +cat < /etc/docker/daemon.json +{ + "bip": "192.168.100.1/24" +} +DAEMON_JSON + +# Restart Docker to apply changes (if systemd is running) +if pidof systemd > /dev/null; then + systemctl restart docker +fi diff --git a/containers/debian/install-incus.sh b/containers/debian/install-incus.sh new file mode 100644 index 0000000..c61261e --- /dev/null +++ b/containers/debian/install-incus.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Update and install prerequisites +apt-get update + +# Install Incus packages +apt-get install -y incus + +incus admin init --auto +incus profile set default security.privileged true +incus remote add hbms https://forgejo.hostedbymyself.de/hbms/ --protocol oci + +incus network list +incus storage list +incus list \ No newline at end of file