Skip to content

Conversation

@alex-kulam
Copy link
Contributor

@alex-kulam alex-kulam commented Jun 24, 2025

Summary by CodeRabbit

  • Chores
    • Updated Cronos version to v1.4.8-testnet in the Docker image.
    • Improved image reproducibility by referencing a specific immutable base image.
    • Adjusted file extraction paths for Cronos binaries within the container.

inoob26 and others added 28 commits October 11, 2022 00:39
…t-image-upgrade

cronos testnet image upgrade
@coderabbitai
Copy link

coderabbitai bot commented Jun 24, 2025

Walkthrough

The Dockerfile was updated to use a specific immutable Debian base image digest, switch the working directory for Cronos binary operations from /tmp to /home/cronos, and upgrade the Cronos version from v0.8.1 to v1.4.8-testnet. The download URL and extraction process were adjusted accordingly.

Changes

File(s) Change Summary
Dockerfile Updated base image to immutable digest, changed working directory to /home/cronos, upgraded Cronos version, adjusted download URL and extraction logic.

Sequence Diagram(s)

sequenceDiagram
    participant Docker Build
    participant Debian Base Image
    participant Cronos Binary Source

    Docker Build->>Debian Base Image: Pull specific digest image
    Docker Build->>Docker Build: Set working dir to /home/cronos
    Docker Build->>Cronos Binary Source: Download v1.4.8-testnet tar.gz
    Docker Build->>Docker Build: Extract files in /home/cronos
    Docker Build->>Docker Build: Continue build steps (user, permissions, entrypoint)
Loading

Possibly related PRs

Poem

In a burrow deep, the Dockerfile grew,
With Cronos upgraded, shiny and new.
A hash-locked base, so firm and tight,
In /home/cronos, binaries alight.
The rabbit hops with a happy cheer,
For reproducible builds are finally here! 🐇✨

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch testnet

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

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

Documentation and Community

  • 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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 100b007 and 12ac4c1.

📒 Files selected for processing (1)
  • Dockerfile (1 hunks)
🧰 Additional context used
🪛 Checkov (3.2.334)
Dockerfile

[HIGH] 8-9: Ensure that certificate validation isn't disabled with wget

(CKV2_DOCKER_3)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: guardrails/scan
🔇 Additional comments (1)
Dockerfile (1)

1-1: Great move: pinning the base image to a digest increases build reproducibility
Using debian:bullseye-slim@sha256:… guarantees the exact image is pulled in every build.

USER cronos

ENTRYPOINT ["/home/cronos/bin/cronosd"]
ENTRYPOINT ["/home/cronos/bin/cronosd"]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

ENTRYPOINT path may be wrong – container will fail to start

After the extraction step you do not move the files, so the binary likely resides at
/home/cronos/cronos_1.4.8-testnet_Linux_x86_64/bin/cronosd (or, with the suggested --strip-components=1, at /home/cronos/bin/cronosd).
However, the ENTRYPOINT points to /home/cronos/bin/cronosd without guaranteeing that path exists.

Please either:

  1. Keep the current extraction layout and adjust ENTRYPOINT:
-ENTRYPOINT ["/home/cronos/bin/cronosd"]
+ENTRYPOINT ["/home/cronos/cronos_1.4.8-testnet_Linux_x86_64/bin/cronosd"]
  1. Or adopt the --strip-components=1 refactor above and leave the ENTRYPOINT as-is.

Without this fix the image will exit with “file not found”.

📝 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
ENTRYPOINT ["/home/cronos/bin/cronosd"]
ENTRYPOINT ["/home/cronos/cronos_1.4.8-testnet_Linux_x86_64/bin/cronosd"]
🤖 Prompt for AI Agents
In Dockerfile at line 15, the ENTRYPOINT path points to
/home/cronos/bin/cronosd, but the binary is not guaranteed to be there after
extraction. To fix this, either adjust the ENTRYPOINT to the actual extracted
path /home/cronos/cronos_1.4.8-testnet_Linux_x86_64/bin/cronosd if you keep the
extraction layout as is, or modify the extraction step to use
--strip-components=1 so the binary is placed directly in /home/cronos/bin/,
allowing the ENTRYPOINT to remain unchanged.

Comment on lines +8 to +9
RUN cd /home/cronos && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.8/cronos_1.4.8-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.8-testnet_Linux_x86_64.tar.gz \
&& rm cronos_1.4.8-testnet_Linux_x86_64.tar.gz
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Remove --no-check-certificate and add integrity checks for the binary download

Disabling TLS validation (--no-check-certificate) opens the build to MITM attacks.
At a minimum, keep certificate verification enabled and verify the tarball’s checksum:

-RUN cd /home/cronos && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.8/cronos_1.4.8-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.8-testnet_Linux_x86_64.tar.gz \
-    && rm cronos_1.4.8-testnet_Linux_x86_64.tar.gz
+RUN set -eu; \
+    cd /home/cronos; \
+    wget --https-only https://github.com/crypto-org-chain/cronos/releases/download/v1.4.8/cronos_1.4.8-testnet_Linux_x86_64.tar.gz; \
+    echo "<SHA256  expected>  cronos_1.4.8-testnet_Linux_x86_64.tar.gz" | sha256sum -c -; \
+    tar --strip-components=1 -xvf cronos_1.4.8-testnet_Linux_x86_64.tar.gz; \
+    rm cronos_1.4.8-testnet_Linux_x86_64.tar.gz

This keeps TLS verification, checks the archive hash, flattens the directory (--strip-components=1) and cleans up in a single layer.

📝 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
RUN cd /home/cronos && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.8/cronos_1.4.8-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.8-testnet_Linux_x86_64.tar.gz \
&& rm cronos_1.4.8-testnet_Linux_x86_64.tar.gz
RUN set -eu; \
cd /home/cronos; \
wget --https-only https://github.com/crypto-org-chain/cronos/releases/download/v1.4.8/cronos_1.4.8-testnet_Linux_x86_64.tar.gz; \
echo "<SHA256 expected> cronos_1.4.8-testnet_Linux_x86_64.tar.gz" | sha256sum -c -; \
tar --strip-components=1 -xvf cronos_1.4.8-testnet_Linux_x86_64.tar.gz; \
rm cronos_1.4.8-testnet_Linux_x86_64.tar.gz
🧰 Tools
🪛 Checkov (3.2.334)

[HIGH] 8-9: Ensure that certificate validation isn't disabled with wget

(CKV2_DOCKER_3)

🤖 Prompt for AI Agents
In Dockerfile lines 8 to 9, remove the wget option `--no-check-certificate` to
re-enable TLS certificate verification and add a step to verify the downloaded
tarball's checksum using a known hash value. Also, update the tar extraction
command to include `--strip-components=1` to flatten the directory structure.
Ensure all these steps are combined in a single RUN layer and clean up the
tarball after verification and extraction.

@alex-kulam alex-kulam closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

8 participants