Update Dockerfile to include python-is-python3 and enhance entrypoint script for conditional package list updates based on network availability.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ameer Hamza Khan
2025-07-31 07:25:04 +00:00
parent 6802f963d0
commit 828a0d72c4
2 changed files with 13 additions and 12 deletions

View File

@@ -24,14 +24,13 @@ RUN apt update && apt install -y \
# Packet analysis tools # Packet analysis tools
tshark \ tshark \
# Programming languages and runtimes # Programming languages and runtimes
python3 python3-pip python3-venv python3-dev \ python3 python3-pip python3-venv python3-dev python-is-python3 \
# Development tools # Development tools
software-properties-common build-essential \ software-properties-common build-essential \
# Remote access # Remote access
openssh-server \ openssh-server \
# Localization # Localization
locales locales
# Note: Keeping apt cache for dev convenience
# Install Node.js using official NodeSource repository # Install Node.js using official NodeSource repository
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \

View File

@@ -1,8 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Gracefully update package lists if network is available if [[ "$UPDATE_APT" == "1" || "${UPDATE_APT,,}" == "true" ]]; then
echo "Checking network connectivity..." # Gracefully update package lists if network is available
if ping -c 1 -W 5 8.8.8.8 >/dev/null 2>&1 || ping -c 1 -W 5 1.1.1.1 >/dev/null 2>&1; then echo "Checking network connectivity..."
if ping -c 1 -W 5 8.8.8.8 >/dev/null 2>&1 || ping -c 1 -W 5 1.1.1.1 >/dev/null 2>&1; then
echo "Network detected, refreshing package lists..." echo "Network detected, refreshing package lists..."
if sudo apt update; then if sudo apt update; then
echo "Package lists updated successfully" echo "Package lists updated successfully"
@@ -10,8 +11,9 @@ if ping -c 1 -W 5 8.8.8.8 >/dev/null 2>&1 || ping -c 1 -W 5 1.1.1.1 >/dev/null 2
echo "Warning: apt update failed despite network connectivity" echo "Warning: apt update failed despite network connectivity"
echo "Falling back to cached package lists" echo "Falling back to cached package lists"
fi fi
else else
echo "No network connectivity detected, using cached package lists" echo "No network connectivity detected, using cached package lists"
fi
fi fi
# Global variable to track background processes # Global variable to track background processes