Skip to content

Add Alpine Linux support for Docker Engine install - #8

Merged
Narehood merged 2 commits into
mainfrom
cursor/alpine-docker-support-04a9
Aug 7, 2026
Merged

Add Alpine Linux support for Docker Engine install#8
Narehood merged 2 commits into
mainfrom
cursor/alpine-docker-support-04a9

Conversation

@Narehood

@Narehood Narehood commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Install Docker Engine (menu option 1) previously always ran the official get.docker.com installer, which fails on Alpine with ERROR: Unsupported distribution 'alpine'.

This change detects Alpine and installs Docker through the distro-native path instead:

  • Enable the Alpine community repository when missing
  • Install docker and docker-cli-compose via apk
  • Enable/start the daemon with OpenRC (rc-update / rc-service)
  • Fail the install if service enable/start fails (no || true suppression)
  • Use addgroup for docker group membership on Alpine
  • Keep the existing temp-file get.docker.com flow for non-Alpine distros
  • Add regression checks so the Alpine/non-Alpine installer branches stay wired correctly

Test plan

  • bash tests/security-checks.sh
  • shellcheck --severity=error install.sh
  • On Alpine Linux: run bash install.sh → option 1 completes without the unsupported-distribution error
  • Confirm docker --version and docker compose version work after install
  • Option 2 adds the current user with Alpine addgroup
  • On Ubuntu/Debian: option 1 still uses the official installer path
Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Added native Docker and Compose installation support for Alpine Linux using the apk package manager.
    • Configures Alpine’s community repository when needed.
    • Supports enabling Docker services through OpenRC or systemd.
    • Preserves the official installer flow for other Linux distributions.
    • Handles Docker group setup according to the detected distribution.
    • Reports service activation failures clearly.
  • Documentation

    • Updated installation capabilities documentation with Alpine-specific instructions.

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>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The installer detects Alpine and installs Docker with apk from the community repository. Other distributions use the official installer. Service activation and Docker group setup support Alpine.

Changes

Docker installation flow

Layer / File(s) Summary
Distribution-based Docker installation
install.sh, README.md, tests/security-checks.sh
install.sh selects Alpine package installation or the official installer. It enables Docker through systemd or OpenRC. Documentation and security checks cover both paths.
Docker group configuration
install.sh
Alpine uses addgroup commands. Other distributions use groupadd and usermod. Membership success is tracked before reporting.

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
Loading

Possibly related PRs

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Alpine Linux support for Docker Engine installation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/alpine-docker-support-04a9

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Narehood
Narehood marked this pull request as ready for review August 7, 2026 16:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/security-checks.sh (1)

60-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Check the Alpine dispatch branch.

These checks pass when install_docker_alpine is unused. Add a regression check that requires the distro_id == "alpine" branch to call install_docker_alpine "$SUDO" and the other branch to call install_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

📥 Commits

Reviewing files that changed from the base of the PR and between c39d9e9 and 4a6fb64.

📒 Files selected for processing (3)
  • README.md
  • install.sh
  • tests/security-checks.sh

Comment thread install.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>
@Narehood
Narehood merged commit 9b0f944 into main Aug 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants