Update Dockerfile to include python-is-python3 and enhance entrypoint script for conditional package list updates based on network availability.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
1 parent
6802f963d0
commit
828a0d72c4
2 files changed
+13
-12
No files matched your search
+12
-10
@@ -1,17 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Gracefully update package lists if network is available
|
||||
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..."
|
||||
if sudo apt update; then
|
||||
echo "Package lists updated successfully"
|
||||
if [[ "$UPDATE_APT" == "1" || "${UPDATE_APT,,}" == "true" ]]; then
|
||||
# Gracefully update package lists if network is available
|
||||
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..."
|
||||
if sudo apt update; then
|
||||
echo "Package lists updated successfully"
|
||||
else
|
||||
echo "Warning: apt update failed despite network connectivity"
|
||||
echo "Falling back to cached package lists"
|
||||
fi
|
||||
else
|
||||
echo "Warning: apt update failed despite network connectivity"
|
||||
echo "Falling back to cached package lists"
|
||||
echo "No network connectivity detected, using cached package lists"
|
||||
fi
|
||||
else
|
||||
echo "No network connectivity detected, using cached package lists"
|
||||
fi
|
||||
|
||||
# Global variable to track background processes
|
||||
|
||||
Reference in new issue
Block a user