Skip to content

Conversation

@imsudiproy
Copy link
Owner

@imsudiproy imsudiproy commented Aug 27, 2025

This PR will fix #15

Summary by CodeRabbit

  • New Features

    • Optional Docker installation inside containers via new install_docker setting (yes/no), supporting Ubuntu, RHEL/CentOS, and SLES/SUSE; verification flow conditionally installs and starts Docker before builds.
  • Documentation

    • Added “Docker Installation Inside Container” section; updated configuration table, examples, and “How It Works.”
    • Clarified Patch Handling steps and added troubleshooting note for unsupported distros; minor wording/formatting improvements.
  • Chores

    • Updated default configuration sample to include install_docker.

@imsudiproy imsudiproy self-assigned this Aug 27, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 27, 2025

Warning

Rate limit exceeded

@imsudiproy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 43 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7d1e71a and a628adc.

📒 Files selected for processing (1)
  • auto_verify.sh (1 hunks)

Walkthrough

Adds an optional install_docker config option and implements an optional in-container Docker installation (Ubuntu, RHEL/CentOS, SLES/SUSE) before executing the build script; updates README (docs, examples, flow, troubleshooting, and patch-handling wording) and adds the new option to config.txt.

Changes

Cohort / File(s) Summary of Changes
Documentation updates
README.md
Adds install_docker option and a new "Docker Installation Inside Container" section; updates configuration table, usage examples, workflow (adds optional Docker install step), troubleshooting (unsupported distro note), and rewords/rehomes "Patch Handling"; minor wording/formatting adjustments.
Container Docker installation feature
auto_verify.sh
Adds conditional in-container Docker installation when install_docker == "yes": detects distro from /etc/os-release; runs distro-specific repo/package steps for Ubuntu, RHEL/CentOS, and SLES/SUSE to install docker-ce, docker-ce-cli, containerd, docker-buildx-plugin, docker-compose-plugin; adds host $USER to docker group and starts dockerd in background; logs unsupported distros; retains patch handling and build-script execution with an explicit start log.
Configuration updates
config.txt
Introduces install_docker="no" (new config key); minor newline/EOF formatting adjustment around patch_path entry.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Runner as auto_verify.sh
  participant Container
  participant PM as Package Manager
  participant Dockerd as Docker daemon
  participant Build as Build Script

  User->>Runner: trigger verification
  Runner->>Container: start & prepare container
  alt install_docker == "yes"
    Container->>Container: read /etc/os-release -> distro
    Container->>PM: add repo(s) & install docker packages
    Container->>Container: add host $USER to docker group
    Container->>Dockerd: start dockerd (background)
    Note right of Dockerd: (wait for readiness)
  else
    Note right of Container: skip docker install
  end
  Container->>Build: execute build script (apply patch if present)
  Build-->>Container: logs & exit status
  Container-->>Runner: collect artifacts & status
  Runner-->>User: report outcome
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Feature

Poem

I hopped through docs and scripts tonight,
Tucked Docker in with gentle bite.
Ubuntu, CentOS, SUSE in a row,
I patched, I started, watched builds grow.
Carrots logged, the CI hums light. 🐇

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docker

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
auto_verify.sh (2)

10-12: Default install_docker to avoid SC2154 and undefined var behavior.

ShellCheck warns because the var may be unset. Provide a safe default after sourcing config.

 source "$config_file"
 
+# Safe defaults for optional config
+: "${install_docker:=no}"
+

136-141: Ensure target user exists before su - test.

Most base images do not have a test user. Create it when requested, and add to docker group if Docker was installed.

-    if [ "$user" == "test" ]; then
+    if [ "$user" == "test" ]; then
+        docker exec "$container_id" bash -c 'id -u test >/dev/null 2>&1 || useradd -m test'
+        if [ "$install_docker" == "yes" ]; then
+            docker exec "$container_id" bash -c 'getent group docker >/dev/null 2>&1 || groupadd docker; usermod -aG docker test'
+        fi
         docker exec "$container_id" su - test -c "bash $script_path -$build_arg" &> "$log_file"
🧹 Nitpick comments (13)
config.txt (1)

7-7: Default install_docker to "no" in committed config.

Checking in "yes" will slow every run and surprise users. Make "no" the default in the template; override locally when needed.

-install_docker="yes" #set yes or no
+install_docker="no" # set yes to install Docker inside the container
README.md (5)

13-13: Tighten prerequisite wording.

Minor grammar tweak for consistency.

-- Permissions to execute scripts and create Docker containers
+- Permission to execute scripts and create Docker containers

32-41: Document privileged requirement and distro caveats.

Installing/running dockerd inside a container requires --privileged. Also call out CentOS 7/yum and openSUSE vs SLES differences.

 | `install_docker` | Install Docker inside the container before running script | `no` or `yes`                                 |
+> Note: Requires containers to be started with `--privileged`. CentOS 7 uses `yum` (not `dnf`); openSUSE differs from SLES repos.

65-66: Mention --privileged in the flow.

Readers need to know why dockerd can start in the container.

-  - Optionally installs Docker inside the container (`install_docker="yes"`)
+  - Optionally installs Docker inside the container (`install_docker="yes"`, container started with `--privileged`)

72-84: Minor list formatting/grammar.

"3. The script will:" reads a bit off in context; also keep tense consistent.

-3. The script will:
+Then the script will:
   - Validate the patch file exists
   - Copy the patch to the container
-  - The patch will be placed in the same directory as the build script
+  - Place the patch in the same directory as the build script

116-118: Troubleshooting entry is good; add CentOS/openSUSE note.

Helps set user expectations.

-6. **"Unsupported distro for Docker install"**
-   - The script only supports Docker installation for Ubuntu, RHEL/CentOS, and SLES/SUSE. Ensure your Docker image is based on one of these distros if you want to use the Docker installation feature.
+6. **"Unsupported distro for Docker install"**
+   - The script supports Ubuntu, RHEL/CentOS, and SLES/openSUSE. CentOS 7 may require `yum` instead of `dnf`; openSUSE uses different repos than SLES.
auto_verify.sh (7)

55-59: Pre-clean any existing container with the same name.

Avoid "Conflict. The container name is already in use" on reruns.

-    container_id=$(docker run -d --privileged --name "$container_name" "$image_name")
+    # Best-effort cleanup if a stale container exists
+    docker rm -f "$container_name" >/dev/null 2>&1 || true
+    container_id=$(docker run -d --privileged --name "$container_name" "$image_name")

131-135: Remove dead/commented code or explain why it stays.

Keep the script lean unless you intend to toggle between strategies.


91-129: Optional: split distro cases more precisely.

rhel|centos and sles|suse collapse repos that diverge (e.g., CentOS 7 vs RHEL, openSUSE vs SLES). Consider separate cases to reduce failures.


25-28: Host logs path under /root may require root.

If non-root runs this script, writing to /root/logs fails. Consider $PWD/logs.

-log_dir="/root/logs"
+log_dir="${LOG_DIR:-$PWD/logs}"

162-165: Parallelize images to speed runs (optional).

For many images, background the jobs and wait.

-for image_name in "${images[@]}"; do
-    echo "Testing image: $image_name"
-    run_verification "$image_name"
-done
+for image_name in "${images[@]}"; do
+    echo "Testing image: $image_name"
+    run_verification "$image_name" &
+done
+wait

39-45: Nit: build_arg values are opaque.

y vs yt is cryptic. Consider --run-tests flag pass-through for clarity.


85-135: Alternative approach: prefer socket bind-mount over DinD.

Consider bind-mounting the host Docker socket (-v /var/run/docker.sock:/var/run/docker.sock) for most cases; reserve DinD for true daemon isolation (e.g., buildx/qemu). This reduces flakiness and install time.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bdf5366 and 0ec374c.

📒 Files selected for processing (3)
  • README.md (5 hunks)
  • auto_verify.sh (1 hunks)
  • config.txt (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
auto_verify.sh

[warning] 86-86: install_docker is referenced but not assigned.

(SC2154)

🪛 LanguageTool
README.md

[grammar] ~11-~11: There might be a mistake here.
Context: ...quisites - Docker installed and running - Bash shell environment - Permissions to ...

(QB_NEW_EN)


[grammar] ~12-~12: There might be a mistake here.
Context: ...led and running - Bash shell environment - Permissions to execute scripts and creat...

(QB_NEW_EN)


[grammar] ~77-~77: There might be a mistake here.
Context: ...ecify the path to your patch file using patch_path 3. The script will: - Validate the patch...

(QB_NEW_EN)


[grammar] ~78-~78: There might be a mistake here.
Context: ...e using patch_path 3. The script will: - Validate the patch file exists - Copy...

(QB_NEW_EN)

🔇 Additional comments (3)
README.md (3)

7-7: Good overview update.

Clear callout that Docker install inside containers is optional. LGTM.


52-53: Match the template default with the committed config.

Keep defaults consistent: both should show install_docker="no".


85-90: Nice new section.

Clear scope and supported distros are helpful.

Comment on lines 85 to 135
#install docker
if [ "$install_docker" == "yes" ]; then
echo "Installing Docker inside container: $container_id" | tee -a "$log_file"

distro=$(docker exec "$container_id" sh -c 'grep "^ID=" /etc/os-release | cut -d= -f2' | tr -d '"')

case "$distro" in
ubuntu)
docker exec "$container_id" bash -c "
apt-get update &&
apt-get install -y ca-certificates curl gnupg sudo &&
install -m 0755 -d /etc/apt/keyrings &&
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc &&
chmod a+r /etc/apt/keyrings/docker.asc &&
echo \"deb [arch=\$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \$(. /etc/os-release && echo \${UBUNTU_CODENAME:-\$VERSION_CODENAME}) stable\" > /etc/apt/sources.list.d/docker.list &&
apt-get update &&
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
sudo usermod -aG docker $USER && newgrp docker
sudo dockerd & &&
sleep 30
"
;;
rhel|centos)
docker exec "$container_id" bash -c "
sudo dnf -y install dnf-plugins-core sudo &&
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo &&
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
sudo usermod -aG docker $USER && newgrp docker
sudo dockerd & &&
sleep 30
"
;;
sles|suse)
docker exec "$container_id" bash -c "
sudo zypper addrepo https://download.docker.com/linux/sles/docker-ce.repo &&
sudo zypper install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo &&
sudo usermod -aG docker $USER && newgrp docker
sudo dockerd & &&
sleep 30
"
;;
*)
echo "Unsupported distro for Docker install: $distro" | tee -a "$log_file"
;;
esac

# # Start Docker daemon
# docker exec -d "$container_id" sh -c "dockerd &"
# sleep 5
fi

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix: $USER expands on the host, newgrp breaks non-interactive scripts, and sleeps are brittle.

  • $USER inside the quoted here-doc expands on the host, not in the container. That user often doesn't exist inside the container.
  • newgrp docker opens a new shell and can hang/skip subsequent lines.
  • Use a deterministic wait loop on docker info instead of fixed sleep 30.
  • sudo inside containers is unnecessary (commands run as root by default).

Apply this minimal patch in all three distro branches.

-                    apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
-                    sudo usermod -aG docker $USER && newgrp docker
-                    sudo dockerd & &&
-                    sleep 30
+                    apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
+                    target_user='"${user:-}"'; if [ -n "$target_user" ] && id -u "$target_user" >/dev/null 2>&1; then usermod -aG docker "$target_user"; fi
+                    nohup dockerd > /var/log/dockerd.log 2>&1 & disown
+                    i=0; until docker info >/dev/null 2>&1 || [ $i -ge 30 ]; do i=$((i+1)); sleep 1; done
@@
-                    sudo dnf -y install dnf-plugins-core sudo &&
-                    sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo &&
-                    sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
-                    sudo usermod -aG docker $USER && newgrp docker
-                    sudo dockerd & &&
-                    sleep 30
+                    dnf -y install dnf-plugins-core sudo || yum -y install yum-utils sudo &&
+                    (dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo || \
+                     yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo) &&
+                    (dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || \
+                     yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin) &&
+                    target_user='"${user:-}"'; if [ -n "$target_user" ] && id -u "$target_user" >/dev/null 2>&1; then usermod -aG docker "$target_user"; fi
+                    nohup dockerd > /var/log/dockerd.log 2>&1 & disown
+                    i=0; until docker info >/dev/null 2>&1 || [ $i -ge 30 ]; do i=$((i+1)); sleep 1; done
@@
-                    sudo zypper addrepo https://download.docker.com/linux/sles/docker-ce.repo &&
-                    sudo zypper install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo &&
-                    sudo usermod -aG docker $USER && newgrp docker
-                    sudo dockerd & &&
-                    sleep 30
+                    zypper -n addrepo https://download.docker.com/linux/sles/docker-ce.repo docker-ce || \
+                    zypper -n addrepo https://download.docker.com/linux/opensuse/docker-ce.repo docker-ce &&
+                    zypper -n install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo ||
+                    zypper -n install docker docker-cli containerd sudo &&
+                    target_user='"${user:-}"'; if [ -n "$target_user" ] && id -u "$target_user" >/dev/null 2>&1; then usermod -aG docker "$target_user"; fi
+                    nohup dockerd > /var/log/dockerd.log 2>&1 & disown
+                    i=0; until docker info >/dev/null 2>&1 || [ $i -ge 30 ]; do i=$((i+1)); sleep 1; done

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 86-86: install_docker is referenced but not assigned.

(SC2154)

🤖 Prompt for AI Agents
In auto_verify.sh lines 85-135, the branch installs use host-expanded $USER,
unnecessary sudo, blocking newgrp, and fixed sleep; fix by removing sudo, avoid
host $USER by resolving the container username inside the exec (e.g. use $(id
-un) or run usermod against the container's user via docker exec "$(id -un)"
resolved inside the container), remove newgrp entirely, start dockerd in
background non-interactively (e.g. nohup dockerd >/dev/null 2>&1 & or run
dockerd & disowned inside the container), and replace sleep 30 with a
deterministic wait loop that checks docker readiness (until docker info
>/dev/null 2>&1; do sleep 1; done); apply same changes to ubuntu, rhel|centos,
and sles|suse branches.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (4)
auto_verify.sh (4)

93-105: Blocking dockerd, host-expanded $USER, and unnecessary sudo/newgrp on Ubuntu path

  • dockerd is started in the foreground and will block the script.
  • $USER expands on the host, not inside the container.
  • newgrp spawns a subshell and breaks non-interactive flows.
  • sudo is redundant inside the container (root by default).
-                docker exec "$container_id" bash -c "
-                    apt-get update &&
-                    apt-get install -y ca-certificates curl gnupg sudo &&
-                    install -m 0755 -d /etc/apt/keyrings &&
-                    curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc &&
-                    chmod a+r /etc/apt/keyrings/docker.asc &&
-                    echo \"deb [arch=\$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \$(. /etc/os-release && echo \${UBUNTU_CODENAME:-\$VERSION_CODENAME}) stable\" > /etc/apt/sources.list.d/docker.list &&
-                    apt-get update &&
-                    apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
-                    sudo usermod -aG docker $USER && newgrp docker
-                "
-                docker exec "$container_id" sh -c "sudo dockerd"
+                docker exec "$container_id" bash -lc '
+                    set -e
+                    apt-get update &&
+                    apt-get install -y ca-certificates curl gnupg &&
+                    install -m 0755 -d /etc/apt/keyrings &&
+                    curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc &&
+                    chmod a+r /etc/apt/keyrings/docker.asc &&
+                    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo ${UBUNTU_CODENAME:-$VERSION_CODENAME}) stable" > /etc/apt/sources.list.d/docker.list &&
+                    apt-get update &&
+                    apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
+                    target_user='"${user:-}"'; if [ -n "$target_user" ] && id -u "$target_user" >/dev/null 2>&1; then usermod -aG docker "$target_user"; fi
+                ' 2>&1 | tee -a "$log_file"
+                docker exec -d "$container_id" sh -c 'nohup dockerd > /var/log/dockerd.log 2>&1 &'

106-114: RHEL/CentOS: handle yum fallback, drop sudo/newgrp, prevent dockerd blocking

dnf may not exist on CentOS 7; add yum-utils fallback. Also same $USER/newgrp/blocking issues as above.

-                docker exec "$container_id" bash -c "
-                    sudo dnf -y install dnf-plugins-core sudo &&
-                    sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo &&
-                    sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &&
-                    sudo usermod -aG docker $USER && newgrp docker
-                "
-                docker exec "$container_id" sh -c "sudo dockerd"
+                docker exec "$container_id" bash -lc '
+                    set -e
+                    dnf -y install dnf-plugins-core || yum -y install yum-utils &&
+                    (dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo || \
+                     yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo) &&
+                    (dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || \
+                     yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin) &&
+                    target_user='"${user:-}"'; if [ -n "$target_user" ] && id -u "$target_user" >/dev/null 2>&1; then usermod -aG docker "$target_user"; fi
+                ' 2>&1 | tee -a "$log_file"
+                docker exec -d "$container_id" sh -c 'nohup dockerd > /var/log/dockerd.log 2>&1 &'

115-123: SLES/SUSE: repo/install fallbacks, drop sudo/newgrp, prevent dockerd blocking

SLES/Leap repo names vary; add opensuse fallback and fall back to docker/docker-cli if docker-ce is unavailable.

-                docker exec "$container_id" bash -c "
-                    sudo zypper addrepo https://download.docker.com/linux/sles/docker-ce.repo &&
-                    sudo zypper install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo &&
-                    sudo usermod -aG docker $USER && newgrp docker
-                "
-                docker exec "$container_id" sh -c "sudo dockerd"
+                docker exec "$container_id" bash -lc '
+                    set -e
+                    zypper -n addrepo https://download.docker.com/linux/sles/docker-ce.repo docker-ce || \
+                    zypper -n addrepo https://download.docker.com/linux/opensuse/docker-ce.repo docker-ce &&
+                    zypper -n install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin || \
+                    zypper -n install docker docker-cli containerd &&
+                    target_user='"${user:-}"'; if [ -n "$target_user" ] && id -u "$target_user" >/dev/null 2>&1; then usermod -aG docker "$target_user"; fi
+                ' 2>&1 | tee -a "$log_file"
+                docker exec -d "$container_id" sh -c 'nohup dockerd > /var/log/dockerd.log 2>&1 &'

128-131: Replace brittle sleeps with deterministic readiness check

Wait for the daemon to become responsive instead of sleeping. This also centralizes readiness after distro-specific setup.

-        # # Start Docker daemon
-        # docker exec -d "$container_id" sh -c "dockerd &"
-        # sleep 5
+        # Wait for Docker in the container to be ready (max ~30s)
+        i=0
+        until docker exec "$container_id" docker info >/dev/null 2>&1 || [ $i -ge 30 ]; do
+            i=$((i+1))
+            sleep 1
+        done
+        if [ $i -ge 30 ]; then
+            echo "Docker in container did not become ready in time." | tee -a "$log_file"
+            docker rm -f "$container_id"
+            return 1
+        fi
🧹 Nitpick comments (2)
auto_verify.sh (2)

89-92: Broaden distro detection (Rocky/Alma/OpenSUSE Leap) or use ID_LIKE

Several popular downstreams won’t match the current case labels. Consider matching rhel|centos|rocky|almalinux and sles|suse|opensuse*, or parse ID_LIKE to route families.

Example:

  • rhel-family: rhel|centos|rocky|almalinux
  • suse-family: sles|suse|opensuse*

133-139: Capture Docker install output to logs and quote script_path

Pipe docker exec output to the same log file and quote the path to avoid issues with whitespace.

-    echo "Started executing the provided script..."
+    echo "Started executing the provided script..." | tee -a "$log_file"
@@
-        docker exec "$container_id" bash $script_path -$build_arg &> "$log_file"
+        docker exec "$container_id" bash "$script_path" -$build_arg &> "$log_file"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0ec374c and 7398a11.

📒 Files selected for processing (1)
  • auto_verify.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
auto_verify.sh

[warning] 86-86: install_docker is referenced but not assigned.

(SC2154)

Comment on lines +86 to +87
if [ "$install_docker" == "yes" ]; then
echo "Installing Docker inside container: $container_id" | tee -a "$log_file"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Guard against unset install_docker (SC2154) and prefer = over ==

Avoid unbound var warnings and make the check robust when the key is missing in config.txt.

-    if [ "$install_docker" == "yes" ]; then
+    if [ "${install_docker:-no}" = "yes" ]; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ "$install_docker" == "yes" ]; then
echo "Installing Docker inside container: $container_id" | tee -a "$log_file"
if [ "${install_docker:-no}" = "yes" ]; then
echo "Installing Docker inside container: $container_id" | tee -a "$log_file"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 86-86: install_docker is referenced but not assigned.

(SC2154)

🤖 Prompt for AI Agents
In auto_verify.sh around lines 86 to 87, the if condition uses an unguarded
variable and the non-POSIX == operator; change the test to guard against unset
install_docker and use = by replacing the condition with a quoted
parameter-expansion default, e.g. if [ "${install_docker:-}" = "yes" ]; then, so
the script won't emit unbound-var warnings and will use the portable
string-equality operator.

@imsudiproy
Copy link
Owner Author

This PR fixes #15

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.

Enhancement: Add optional docker installation

2 participants