Save yourself a few keystrokes. Follow the steps below:
-
Run this Bash script on your laptop:
#!/usr/bin/env bash
| #!/bin/bash | |
| echo 'linux/amd64' > README-linux-amd64.md | |
| echo 'linux/arm64' > README-linux-arm64.md | |
| # Push the artifact for amd64 and get the digest | |
| DIGEST_LINUX_AMD64=$(oras push --oci-layout layout-dir README-linux-amd64.md --format go-template='{{.digest}}') | |
| # Push the artifact for arm64 and get the digest | |
| DIGEST_LINUX_ARM64=$(oras push --oci-layout layout-dir README-linux-arm64.md --format go-template='{{.digest}}') |
| #!/bin/bash | |
| # Variables | |
| acrName= | |
| resourceGroup= | |
| vmName= | |
| # Create ACR task with encoded YAML | |
| az acr task create \ | |
| --name startvm \ |
Create readonly token in the security tab - https://hub.docker.com/settings/security
This is optional and you can use an existing keyvault
| #gh api repos/opencontainers/image-spec/contributors > /tmp/contributors.json | |
| # cat /tmp/contributors.json | jq -r '.[] | @text "| \(.login) | ) | "' | |
| get_contributors() | |
| { | |
| REPO=$1 | |
| FILE_NAME=/tmp/contributors-$REPO.json | |
| gh api repos/opencontainers/$REPO/contributors > $FILE_NAME | |
| cat $FILE_NAME | jq -r '.[] | @text "| \(.login) | ) | "' | |
| } |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| for REGION in $(aws ec2 describe-regions --output text --query 'Regions[].[RegionName]'| cat) ; do | |
| echo $REGION | |
| id=$(aws ec2 describe-volumes \ | |
| --filter "Name=status,Values=available" \ | |
| --query 'Volumes[*].[VolumeId]' \ | |
| --output text --region $REGION | cat) ; | |
| echo $id |
export REGISTRY_NAME=sphere
export REGISTRY=${REGISTRY_NAME}".azurecr.io"
az acr create --name $REGISTRY_NAME --sku Premium --resource-group test --location wcus
az acr update -n $REGISTRY_NAME --anonymous-pull-enabled true| #!/bin/sh | |
| set -e | |
| REGISTRY="sajay.azurecr.io" | |
| REPOSITORY="hello-world" | |
| AAD_ACCESS_TOKEN=$(az account get-access-token --query accessToken -o tsv) | |
| ACR_REFRESH_TOKEN=$(curl -s -X POST -H "Content-Type: application/x-www-form-urlencoded" \ | |
| -d "grant_type=access_token&service=$REGISTRY&access_token=$AAD_ACCESS_TOKEN" \ | |
| https://$REGISTRY/oauth2/exchange \ |