d-utils

simple utils to use docker images without docker
git clone https://git.ce9e.org/d-utils.git

commit
2f58d42da9e0c92ea3e0386192d2fcdbc2dd6d17
parent
832a68a262522c184ef444fe3648a4e652ccb8c8
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2026-04-21 09:17
fix auth header parsing

Diffstat

M d-pull 4 ++--

1 files changed, 2 insertions, 2 deletions


diff --git a/d-pull b/d-pull

@@ -43,9 +43,9 @@ echo "pulling $reg/$lib/$img:$tag to $dir"
   43    43 url="https://$reg/v2/$lib/$img"
   44    44 
   45    45 echo "  fetching token"
   46    -1 auth_url=$(curl -s --head "https://$reg/v2/" | grep -i www-authenticate | sed 's/.*realm="\(.*\)",service="\(.*\)".*/\1?service=\2/')
   -1    46 auth_url=$(curl -s --head "https://$reg/v2/" | grep -i www-authenticate | sed 's/.*realm="\([^"]*\)",service="\([^"]*\)".*/\1?service=\2/')
   47    47 if [ -z "$auth_url" ]; then
   48    -1 	auth_url=$(curl -s --head "$url/manifests/$tag" | grep -i www-authenticate | sed 's/.*realm="\(.*\)",service="\(.*\)".*/\1?service=\2/')
   -1    48 	auth_url=$(curl -s --head "$url/manifests/$tag" | grep -i www-authenticate | sed 's/.*realm="\([^"]*\)",service="\([^"]*\)".*/\1?service=\2/')
   49    49 fi
   50    50 auth_token=$(curl -s "$auth_url&scope=repository:$lib/$img:pull" | jq -r '.token')
   51    51 auth="Authorization: Bearer $auth_token"