-
Notifications
You must be signed in to change notification settings - Fork 0
Docker multi arch #1
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||
| # Docker Multi-Arch images overview script | ||||||
|
|
||||||
| The script will return an overview of your Docker multi-arch images stored in your Cloudsmith repository. | ||||||
| It provides a hierarchial breakdown of each image by tag, showing the index digest and it's associated manifest digests with their platform, cloudsmith sync status and downloads count. | ||||||
|
|
||||||
| Each image has a total downloads count rolled up from all digests which the current Cloudsmith UI/ API does not provide. | ||||||
|
|
||||||
| <img src="example.gif" width=50%> | ||||||
|
|
||||||
| ## Prequisities | ||||||
|
||||||
| ## Prequisities | |
| ## Prerequisites |
Copilot
AI
Sep 19, 2025
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.
Typo: 'arguements' should be 'arguments'
| Execute run.sh and pass in 4 arguements ( domain, org, repo and image name). | |
| Execute run.sh and pass in 4 arguments ( domain, org, repo and image name). |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,237 @@ | ||||||
| #!/usr/bin/env bash | ||||||
| set -euo pipefail | ||||||
|
|
||||||
| # Usage: ./run.sh <org> <repo> <img> | ||||||
| # Requires: curl, jq | ||||||
| # Auth: export CLOUDSMITH_API_KEY=<your_token> | ||||||
|
|
||||||
| # Color setup (auto-disable if not a TTY or tput missing) | ||||||
| if [ -t 1 ] && command -v tput >/dev/null 2>&1 && [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then | ||||||
| GREEN="$(tput setaf 2)"; RED="$(tput setaf 1)"; RESET="$(tput sgr0)" | ||||||
| else | ||||||
| GREEN=""; RED=""; RESET="" | ||||||
| fi | ||||||
|
|
||||||
| # Icons (fallback to ASCII if not on UTF-8 locale) | ||||||
| CHECK='✅'; CROSS='❌'; TIMER='⏳'; VULN='☠️' | ||||||
| case ${LC_ALL:-${LC_CTYPE:-$LANG}} in *UTF-8*|*utf8*) : ;; *) CHECK='OK'; CROSS='X' ;; esac | ||||||
|
|
||||||
| completed() { printf '%s%s%s %s\n' "$GREEN" "$CHECK" "$RESET" "$*"; } | ||||||
| progress() { printf '%s%s%s %s\n' "$YELLOW" "$TIMER" "$RESET" "$*"; } | ||||||
|
||||||
| quarantined() { printf '%s%s%s %s\n' "$ORANGE" "$VULN" "$RESET" "$*"; } | ||||||
|
||||||
| fail() { printf '%s%s%s %s\n' "$RED" "$CROSS" "$RESET" "$*"; } | ||||||
|
|
||||||
| CLOUDSMITH_URL="${1:-}" | ||||||
| WORKSPACE="${2:-}" | ||||||
| REPO="${3:-}" | ||||||
| IMG="${4:-}" | ||||||
|
|
||||||
| if [[ -z "${CLOUDSMITH_URL}" ]]; then | ||||||
| CLOUDSMITH_URL="https://docker.cloudsmith.io" | ||||||
| fi | ||||||
|
|
||||||
| # uthorization header | ||||||
|
||||||
| # uthorization header | |
| # Authorization header |
Copilot
AI
Sep 19, 2025
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.
Variable FAIL is referenced but never defined. This should be CROSS based on the other status display patterns.
Copilot
AI
Sep 19, 2025
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.
Variable FAIL is referenced but never defined. This should be CROSS based on the other status display patterns.
Copilot
AI
Sep 19, 2025
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.
The totalDownloads variable is declared as local inside getDockerDigests function but is being incremented inside the nested getPackageData function where it's not accessible. This will always show 0 downloads.
Copilot
AI
Sep 19, 2025
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.
The totalDownloads variable is declared as local inside getDockerDigests function but is being incremented inside the nested getPackageData function where it's not accessible. This will always show 0 downloads.
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.
Typo: 'hierarchial' should be 'hierarchical'