Created
August 17, 2022 02:29
-
-
Save pansapiens/ec8a5ed18eebf2970f7c34a9a473ec7e to your computer and use it in GitHub Desktop.
Grab the latest Singularity container for a bioconda package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# ./get_latest_container.sh | |
# Given a bioconda package name as the first argument, downloads | |
# the most recent corresponding Singularity image from quay.io/biocontainers | |
# | |
# Usage: | |
# | |
# ./get_latest_container.sh <package_name> | |
# | |
# Requires: python, curl, singularity | |
PACKAGE=$1 | |
URL="https://quay.io/api/v1/repository/biocontainers/${PACKAGE}/tag/?limit=1&page=1&onlyActiveTags=true" | |
TAG=$(curl -H 'Content-Type: application/json' "${URL}" | python -c "import sys, json; print(json.loads(sys.stdin.read())['tags'][0]['name'])") | |
singularity pull "docker://quay.io/biocontainers/${PACKAGE}:${TAG}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment