[PR #56] [MERGED] Improve Docker downgrade script robustness #70

Closed
opened 2025-11-20 04:14:29 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bigbeartechworld/big-bear-scripts/pull/56
Author: @dragonfire1119
Created: 11/11/2025
Status: Merged
Merged: 11/11/2025
Merged by: @dragonfire1119

Base: masterHead: fix-downgrade-not-working


📝 Commits (1)

  • 0dc8491 Improve Docker downgrade script robustness

📊 Changes

1 file changed (+59 additions, -20 deletions)

View changed files

📝 casaos-fix-docker-api-version/run.sh (+59 -20)

📄 Description

This pull request improves the robustness and user experience of the CasaOS Docker version fix script. The most important changes include enhanced error handling during Docker installation, improved package version reporting, and safer backup logic. These updates make the script more reliable and informative for users troubleshooting Docker compatibility issues.

Error handling and installation robustness:

  • Improved error handling during Docker package installation by using nested conditional statements instead of chained || blocks. The script now tries multiple installation methods and provides a clear error message if all attempts fail.
  • Ensured a clean downgrade by removing existing Docker packages and stopping related services before reinstallation.

User experience and reporting improvements:

  • Enhanced version reporting by displaying both Docker API and package versions using dpkg -l, and consistently using the SUDO variable for commands requiring elevated privileges. [1] [2]
  • Improved container runtime testing by adding a timeout to docker run commands to prevent indefinite hangs, and clarified messaging during the test process.

Safety and reliability:

  • Added checks to ensure backup of /var/lib/docker only occurs if the directory exists, preventing errors during backup.
  • Improved user prompt handling for Docker reset confirmation, ensuring a default response if input fails.

Other minor updates include version bumping in the script banner and initialization of the SUDO variable for consistent privilege escalation.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bigbeartechworld/big-bear-scripts/pull/56 **Author:** [@dragonfire1119](https://github.com/dragonfire1119) **Created:** 11/11/2025 **Status:** ✅ Merged **Merged:** 11/11/2025 **Merged by:** [@dragonfire1119](https://github.com/dragonfire1119) **Base:** `master` ← **Head:** `fix-downgrade-not-working` --- ### 📝 Commits (1) - [`0dc8491`](https://github.com/bigbeartechworld/big-bear-scripts/commit/0dc84915cf6541e21c2536a00ba60a5adcea4e27) Improve Docker downgrade script robustness ### 📊 Changes **1 file changed** (+59 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `casaos-fix-docker-api-version/run.sh` (+59 -20) </details> ### 📄 Description This pull request improves the robustness and user experience of the CasaOS Docker version fix script. The most important changes include enhanced error handling during Docker installation, improved package version reporting, and safer backup logic. These updates make the script more reliable and informative for users troubleshooting Docker compatibility issues. **Error handling and installation robustness:** * Improved error handling during Docker package installation by using nested conditional statements instead of chained `||` blocks. The script now tries multiple installation methods and provides a clear error message if all attempts fail. * Ensured a clean downgrade by removing existing Docker packages and stopping related services before reinstallation. **User experience and reporting improvements:** * Enhanced version reporting by displaying both Docker API and package versions using `dpkg -l`, and consistently using the `SUDO` variable for commands requiring elevated privileges. [[1]](diffhunk://#diff-198701c5a479170ce972c97f3fc3fffdb839d314cdf1e68849f24463f63756aaL41-R54) [[2]](diffhunk://#diff-198701c5a479170ce972c97f3fc3fffdb839d314cdf1e68849f24463f63756aaL815-R858) * Improved container runtime testing by adding a timeout to `docker run` commands to prevent indefinite hangs, and clarified messaging during the test process. **Safety and reliability:** * Added checks to ensure backup of `/var/lib/docker` only occurs if the directory exists, preventing errors during backup. * Improved user prompt handling for Docker reset confirmation, ensuring a default response if input fails. Other minor updates include version bumping in the script banner and initialization of the `SUDO` variable for consistent privilege escalation. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:14:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/big-bear-scripts#70