Transmode / gradle-docker

A Gradle plugin to build Docker images from the build script.
Apache License 2.0
647 stars 142 forks source link

Docker task "push" Results in Error when Pushing through API #31

Open colinbjohnson opened 10 years ago

colinbjohnson commented 10 years ago

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.