$ mkdir -p ~/.docker $ AUTH=$(echo -n "$REGISTRY_USERNAME:$REGISTRY_SECRET" | base64) # Note: If using Docker Hub, the registry URL is `https://index.docker.io/v1/` for the auth config $ cat <~/.docker/config.json { "auths": { "$REGISTRY": { "auth": "$AUTH" } } } EOF