-
Notifications
You must be signed in to change notification settings - Fork 12
cli: lock container image digests #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: prerelease/v2-alpha
Are you sure you want to change the base?
cli: lock container image digests #362
Conversation
|
Coverage Report for ./apps/cli
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors Docker image configuration to support pinned SHA256 digests for reproducible builds. The main goal is to ensure consistent image versions across deployments by allowing the use of digest-pinned images when a runtime version is not explicitly specified.
- Expanded SDK image configuration from a single constant to separate name, tag, and SHA256 digest constants for SDK, database, and runtime images
- Modified environment setup to conditionally use digest-pinned images or version tags based on whether a runtime version is specified
- Updated Docker Compose files to use fully qualified image references with SHA256 digests for third-party and Cartesi images
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/cli/src/config.ts | Adds separate constants for image names, tags, and SHA256 digests for SDK, database, and runtime images; missing semicolons on export statements |
| apps/cli/src/exec/rollups.ts | Implements conditional logic to use digest-pinned images when runtime version is undefined; updates environment variable setup |
| apps/cli/src/commands/run.ts | Changes runtime version default from explicit version to undefined, enabling digest-pinned images by default |
| apps/cli/src/compose/docker-compose-proxy.yaml | Pins traefik image to specific version with SHA256 digest |
| apps/cli/src/compose/docker-compose-node.yaml | Replaces version-based environment variable with configurable runtime image variable |
| apps/cli/src/compose/docker-compose-explorer.yaml | Pins explorer-related images to specific versions with SHA256 digests |
| apps/cli/src/compose/docker-compose-database.yaml | Replaces version-based environment variable with configurable database image variable |
Comments suppressed due to low confidence (3)
apps/cli/src/config.ts:83
- Avoid automated semicolon insertion (90% of all statements in the enclosing script have an explicit semicolon).
export const DEFAULT_SDK_IMAGE_SHA256_DIGEST = "406e35fdabf189be2ffc3b47c23ad31b4864cf24f012db01e04d6b254e1e57f4"
apps/cli/src/config.ts:86
- Avoid automated semicolon insertion (90% of all statements in the enclosing script have an explicit semicolon).
export const DEFAULT_SDK_DATABASE_IMAGE_SHA256_DIGEST = "b179de07c32894407e3e1eff060899a462d31d4fe6892e0f075daff74f83ebd9"
apps/cli/src/config.ts:89
- Avoid automated semicolon insertion (90% of all statements in the enclosing script have an explicit semicolon).
export const DEFAULT_SDK_RUNTIME_IMAGE_SHA256_DIGEST = "6b198f746762f93d61e2c127628e0c92b4424d2ff7c2f9161c8a47c04ab407f4"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request updates the way container images are referenced and managed for the CLI and Docker Compose files, ensuring more robust and secure deployments by using pinned image digests and environment variables. It also improves SDK version handling by making the runtime version optional and updating how defaults are set. The most important changes are grouped below:
Container Image Pinning and Environment Variable Usage
docker-compose-database.yaml,docker-compose-explorer.yaml,docker-compose-node.yaml,docker-compose-proxy.yaml) now use environment variables for image names and tags, and images are referenced by their full registry URLs and pinned SHA256 digests for improved security and reproducibility. [1] [2] [3] [4] [5] [6]exec/rollups.ts) determines which image (with or without digest) to use based on whether a runtime version is specified, preferring pinned digests when not specified. [1] [2]SDK Version and Image Configuration
config.ts, and the default SDK image reference uses these values. [1] [2] [3] [4]runtimeVersionoption in CLI commands and environment setup is now optional (string | undefined), and the default value for the CLI option is set toundefinedinstead of a specific version. [1] [2]Minor Cleanup
These changes make the deployment process more flexible, secure, and maintainable by centralizing image configuration and using digest-pinned images.