76 lines
1.8 KiB
Docker
76 lines
1.8 KiB
Docker
FROM ubuntu:22.04
|
|
|
|
# Avoid prompts during package installation
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV TZ=UTC
|
|
|
|
# Set ZSH as default shell
|
|
ENV SHELL=/usr/bin/zsh
|
|
|
|
# Install essential packages
|
|
RUN apt update && apt install -y \
|
|
# DNS and networking
|
|
unbound \
|
|
dnsutils \
|
|
bind9-utils \
|
|
net-tools \
|
|
iputils-ping \
|
|
traceroute \
|
|
curl \
|
|
wget \
|
|
# SSH server
|
|
openssh-server \
|
|
# Shell and utilities
|
|
zsh \
|
|
git \
|
|
vim \
|
|
nano \
|
|
htop \
|
|
tmux \
|
|
tree \
|
|
ncdu \
|
|
# System tools
|
|
sudo \
|
|
ca-certificates \
|
|
gnupg \
|
|
lsb-release \
|
|
software-properties-common \
|
|
# Build tools (useful for compiling)
|
|
build-essential \
|
|
# Process management
|
|
supervisor \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Oh My Zsh (for root)
|
|
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
|
|
|
# Set ZSH as default shell for root
|
|
RUN chsh -s /usr/bin/zsh root
|
|
|
|
# Configure SSH
|
|
RUN mkdir /var/run/sshd && \
|
|
# Change SSH port to 2222
|
|
sed -i 's/#Port 22/Port 2222/' /etc/ssh/sshd_config && \
|
|
# Enable root login (change to 'no' if you want to create a separate user)
|
|
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
|
|
# SSH login fix for container
|
|
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
|
|
|
# Set a default root password (CHANGE THIS!)
|
|
RUN echo 'root:changeme123' | chpasswd
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p /var/log/supervisor /config/unbound /config/supervisor
|
|
|
|
# Copy supervisor configuration
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
# Expose ports
|
|
EXPOSE 2222 5335
|
|
|
|
# Working directory
|
|
WORKDIR /config
|
|
|
|
# Start supervisor
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|