mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-15 10:18:45 +00:00
20 lines
679 B
Bash
Executable File
20 lines
679 B
Bash
Executable File
#!/bin/bash
|
|
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721
|
|
|
|
# Example for the Docker Hub V2 API
|
|
# Returns all images and tags associated with a Docker Hub organization account.
|
|
# Requires 'jq': https://stedolan.github.io/jq/
|
|
|
|
TOKEN_FILE=~/.docker/.token
|
|
|
|
# set username, password, and organization
|
|
read -p "Username: " UNAME
|
|
read -s -p "Password: " UPASS
|
|
echo
|
|
|
|
# get token
|
|
echo "Retrieving token ..."
|
|
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${UNAME}'", "password": "'${UPASS}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
|
|
|
|
echo "$TOKEN" >"${TOKEN_FILE}"
|