Add Alpine Linux support for Docker Engine install - #8
Conversation
get.docker.com rejects Alpine, so menu option 1 now detects Alpine and installs docker + docker-cli-compose from the community repo, enabling the service through OpenRC. Also use addgroup for Docker group membership on Alpine and guard the path with security checks. Co-authored-by: Michael <Narehood@users.noreply.github.com>
📝 WalkthroughWalkthroughThe installer detects Alpine and installs Docker with ChangesDocker installation flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant install.sh
participant detect_distro_id
participant apk
participant OfficialInstaller
participant enable_docker_service
install.sh->>detect_distro_id: Detect distribution
alt Alpine
install.sh->>apk: Install docker and docker-cli-compose
else Other distribution
install.sh->>OfficialInstaller: Download and run installer
end
install.sh->>enable_docker_service: Enable and start Docker service
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/security-checks.sh (1)
60-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCheck the Alpine dispatch branch.
These checks pass when
install_docker_alpineis unused. Add a regression check that requires thedistro_id == "alpine"branch to callinstall_docker_alpine "$SUDO"and the other branch to callinstall_docker_official "$SUDO".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/security-checks.sh` around lines 60 - 68, Extend the security checks around the Alpine dispatch logic to require install.sh’s distro_id == "alpine" branch to invoke install_docker_alpine "$SUDO" and its non-Alpine branch to invoke install_docker_official "$SUDO"; ensure the checks validate both calls are tied to their respective branches rather than merely existing or being unused.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@install.sh`:
- Around line 454-469: Update the Docker service activation logic in
install_docker_alpine and install_docker_official to remove the || true
suppression from systemctl, rc-update, and service-start commands. Check each
enable/start result, return a nonzero status on failure, and only print the
success message and return 0 after all required operations succeed; propagate
these failures from both installation functions.
---
Nitpick comments:
In `@tests/security-checks.sh`:
- Around line 60-68: Extend the security checks around the Alpine dispatch logic
to require install.sh’s distro_id == "alpine" branch to invoke
install_docker_alpine "$SUDO" and its non-Alpine branch to invoke
install_docker_official "$SUDO"; ensure the checks validate both calls are tied
to their respective branches rather than merely existing or being unused.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1661888f-0f10-4763-a7f5-9ca72f6f669b
📒 Files selected for processing (3)
README.mdinstall.shtests/security-checks.sh
Propagate enable/start errors from systemd and OpenRC instead of swallowing them with || true, and require security-checks to assert the alpine/non-alpine installer branches call the matching helpers. Co-authored-by: Michael <Narehood@users.noreply.github.com>
Summary
Install Docker Engine(menu option 1) previously always ran the officialget.docker.cominstaller, which fails on Alpine withERROR: Unsupported distribution 'alpine'.This change detects Alpine and installs Docker through the distro-native path instead:
dockeranddocker-cli-composeviaapkrc-update/rc-service)|| truesuppression)addgroupfor docker group membership on Alpineget.docker.comflow for non-Alpine distrosTest plan
bash tests/security-checks.shshellcheck --severity=error install.shbash install.sh→ option1completes without the unsupported-distribution errordocker --versionanddocker compose versionwork after install2adds the current user with Alpineaddgroup1still uses the official installer pathSummary by CodeRabbit
New Features
apkpackage manager.Documentation