Skip to content

Instantly share code, notes, and snippets.

@ccampo133
Created October 16, 2025 14:36
Show Gist options
  • Select an option

  • Save ccampo133/99109293a0e0e9b859afaddd3dc0f524 to your computer and use it in GitHub Desktop.

Select an option

Save ccampo133/99109293a0e0e9b859afaddd3dc0f524 to your computer and use it in GitHub Desktop.
Shell script to search Chainguard packages (using Docker)
#!/usr/bin/env sh
if [ $# -eq 0 ]; then
echo "Usage: apkcg <command> [options]"
echo "Note: Quote wildcards to prevent shell expansion (e.g., apkcg search \"php*8.2*xml*\")"
echo "Examples:"
echo " apkcg search curl"
echo " apkcg info busybox"
echo " apkcg list --available"
exit 1
fi
# Ref: https://edu.chainguard.dev/chainguard/migration/migrating-to-chainguard-images/#searching-for-packages
docker run --rm cgr.dev/chainguard/wolfi-base sh -c "apk update >/dev/null 2>&1 && apk $*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment