add install scripts for Docker and Incus; enhance Dockerfile with additional packages and configurations
All checks were successful
All checks were successful
This commit is contained in:
parent
a06498d67e
commit
ea78ae7913
3 changed files with 52 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ RUN apt-get update && apt-get upgrade -y && \
|
||||||
openssh-server \
|
openssh-server \
|
||||||
openssl \
|
openssl \
|
||||||
python3 \
|
python3 \
|
||||||
|
python3-venv \
|
||||||
sudo \
|
sudo \
|
||||||
nano \
|
nano \
|
||||||
btop \
|
btop \
|
||||||
|
|
@ -21,9 +22,20 @@ RUN apt-get update && apt-get upgrade -y && \
|
||||||
systemd-sysv \
|
systemd-sysv \
|
||||||
dbus \
|
dbus \
|
||||||
ifupdown \
|
ifupdown \
|
||||||
|
iputils-ping \
|
||||||
|
dnsutils \
|
||||||
|
unattended-upgrades \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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
|
# Install Tailscale
|
||||||
RUN curl -fsSL https://tailscale.com/install.sh | sh
|
RUN curl -fsSL https://tailscale.com/install.sh | sh
|
||||||
|
|
||||||
|
|
@ -42,6 +54,7 @@ RUN mkdir -p /etc/apt/keyrings && \
|
||||||
# Configure Services
|
# Configure Services
|
||||||
RUN systemctl enable ssh
|
RUN systemctl enable ssh
|
||||||
RUN systemctl enable cron
|
RUN systemctl enable cron
|
||||||
|
RUN systemctl enable unattended-upgrades
|
||||||
RUN systemctl enable incus-agent || true
|
RUN systemctl enable incus-agent || true
|
||||||
RUN systemctl enable tailscaled || true
|
RUN systemctl enable tailscaled || true
|
||||||
RUN ssh-keygen -A
|
RUN ssh-keygen -A
|
||||||
|
|
@ -54,8 +67,11 @@ RUN mkdir -p /root/.ssh && \
|
||||||
chmod 600 /root/.ssh/authorized_keys && \
|
chmod 600 /root/.ssh/authorized_keys && \
|
||||||
chmod 700 /root/.ssh
|
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 && \
|
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
|
EXPOSE 22
|
||||||
|
|
||||||
|
|
|
||||||
20
containers/debian/install-docker.sh
Normal file
20
containers/debian/install-docker.sh
Normal file
|
|
@ -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 <<DAEMON_JSON > /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
|
||||||
15
containers/debian/install-incus.sh
Normal file
15
containers/debian/install-incus.sh
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue