export def get_image_digest [image: string, tag: string] { let token = ( get_token $image ) mut headers = ( [] | append [Accept "application/vnd.docker.distribution.manifest.v2+json"] | append [Authorization $"Bearer ($token)"] ) ( http get -H $headers $"https://registry.hub.docker.com/v2/($image)/manifests/($tag)" | from json | get config | get digest | split row ":" | get 1 ) } def get_token [image: string] { http get $"https://auth.docker.io/token?scope=repository:($image):pull&service=registry.docker.io" | get token }