gradle-docker
gradle-docker copied to clipboard
Docker task "push" Results in Error when Pushing through API
Example:
task buildImage(type: Docker) {
buildImage.dependsOn('prepBuildImage')
dockerfile 'Dockerfile'
tag = 'colinbjohnson/test'
tagVersion = '1.0'
push true
apiUsername = 'x'
apiPassword = 'x'
apiEmail = 'x'
}
Returns:
Execution failed for task ':buildImage'.
> Docker API error: Failed to build Image:
Invalid repository name (test:1.0), only [a-z0-9-_.] are allowed
I'm not sure exactly what is going on - when using curl to push (example: curl -X POST -H "X-Registry-Auth: x" http://192.168.2.2:2375/images/colinbjohnson/test/push) I'm able to push successfully, but when pushing through gradle the URL is POST http://192.168.2.2:2375/v1.11/images/colinbjohnson/test:latest/push or POST http://192.168.2.2:2375/v1.11/images/colinbjohnson/test:$tagVersion/push - neither of which seem to work. My experience with the API leads me to believe can't push both a repository (example: colinbjohnson/test) and and a tag.