Improved the script to add more useful packages and improved the entrypoint script.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ameer Hamza Khan
2025-07-27 13:09:14 +00:00
parent eada31f646
commit bb6dc6ab2e
3 changed files with 101 additions and 60 deletions

View File

@@ -2,40 +2,60 @@ ARG UBUNTU_VER
FROM ubuntu:${UBUNTU_VER}
ARG TARGETPLATFORM
ENV DEBIAN_FRONTEND=noninteractive
# Enable autocompletion
RUN rm /etc/apt/apt.conf.d/docker-*
RUN echo "if [ -f /etc/bash_completion ] && ! shopt -oq posix; then \
. /etc/bash_completion; \
fi" >> /root/.bashrc
# Enable autocompletion and install packages in optimized layers
RUN rm /etc/apt/apt.conf.d/docker-* && \
echo 'if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion; fi' >> /root/.bashrc
RUN apt update
RUN apt update && apt install -y \
# Basic utilities
curl wget nano lsb-release sudo bash-completion jq git screen cron \
# Basic networking tools
net-tools iputils-ping iproute2 iptables dnsutils \
# Network diagnostic and probing tools
tcpdump traceroute netcat-openbsd nmap telnet whois mtr-tiny socat \
# Network performance tools
iperf3 speedtest-cli \
# Network configuration utilities
resolvconf bridge-utils vlan \
# VPN and tunneling tools
wireguard-tools openvpn stunnel4 \
# Packet analysis tools
tshark \
# Programming languages and runtimes
python3 python3-pip python3-venv python3-dev \
# Development tools
software-properties-common build-essential \
# Remote access
openssh-server \
# Localization
locales
# Note: Keeping apt cache for dev convenience
RUN apt install -y curl wget nano lsb-release nano sudo bash-completion jq git screen cron
# Install Node.js using official NodeSource repository
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \
apt-get install -y nodejs
RUN apt install -y net-tools iputils-ping tcpdump traceroute iproute2 iptables iperf3 dnsutils speedtest-cli
RUN apt install -y software-properties-common
RUN apt install -y openssh-server
# Installing locales
RUN apt install -y locales
# Configure locales
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN locale-gen en_US.UTF-8
# Allow non-root users to run sudo command without password.
# Configure SSH
RUN mkdir -p /var/run/sshd
# Allow non-root users to run sudo command without password
RUN echo "ALL ALL=NOPASSWD:ALL" > /etc/sudoers.d/01-allow-sudo
COPY scripts/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV LOG_FILE=/dev/null
# Reset DEBIAN_FRONTEND
ENV DEBIAN_FRONTEND=""
CMD [ "/entrypoint.sh" ]
EXPOSE 22
CMD ["/entrypoint.sh"]