Skip to content

Instantly share code, notes, and snippets.

@northtyphoon
Created November 12, 2022 02:04
Show Gist options
  • Save northtyphoon/0866a274185fe89082da8b6614660663 to your computer and use it in GitHub Desktop.
Save northtyphoon/0866a274185fe89082da8b6614660663 to your computer and use it in GitHub Desktop.
# Prerequisite
# 1) Install az-cli, docker, oras (0.16+), jq

registry="myregistry.azurecr.io"
repo="myimage"
tag="mytag"
reference=$registry/$myimage:$mytag

az login
az acr login -n $registry

oras version
oras discover -o json $reference

# attach an artifact to the image
echo "hello world" > hi.txt
oras attach --artifact-type example/hello-world --export-manifest manifest.json $reference hi.txt
cat manifest.json | jq

# discover the artifact
oras discover -o json $reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment