I am trying to use an arg substitution with jq and one of the args needs to be a key.I have tried$reg
- error
"$reg"
- no sub
\$reg
- error
Can this be done?
export USERNAME=joeexport PASSWORD=whateverexport DOCKER_REGISTRY="hub.docker.io"jq -n --arg reg "${DOCKER_REGISTRY}" \ --arg u "$USERNAME" \ --arg p "${PASSWORD}" \ --arg auth "$(echo "$USERNAME:$PASSWORD" | base64)" \'{"auths": { $reg: {"username": $u,"password": $p,"auth": $auth } } }'