Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require docker login when push=true #137

Open
benfortuna opened this issue May 31, 2018 · 4 comments
Open

Require docker login when push=true #137

benfortuna opened this issue May 31, 2018 · 4 comments

Comments

@benfortuna
Copy link

It appears you need to run docker login prior to pushing to hub.docker.com.

Would it be possible to integrate this in the plugin? Currently push will fail with following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildDocker'.
> Docker execution failed
  Command line [docker push image/example:1.0] returned:
  denied: requested access to the resource is denied

Task configuration is like this:

docker {
    baseImage "image/base:1"
}

task buildDocker(type: Docker) {
    applicationName = 'image/example'
    tagVersion = '1.0'
    push true
    apiUsername = username
    apiPassword = password
    apiEmail = [email protected]
}

I haven't tried with useApi=true as yet as that was giving a different error.

@bjornmagnusson
Copy link
Contributor

Does it work if you perform docker login before running your build?

@benfortuna
Copy link
Author

Yes, can confirm if I run docker login first the push will be successful.

However if it can be integrated into the plugin it would save some trouble configuring automated builds.

@bjornmagnusson
Copy link
Contributor

If you can provide an proposal on how to fix this, I would be prepared to take a look at it. Contributions are very welcome

@jamesdube
Copy link

I'd be willing to help too bad I don't know much about developing gradle plugins, if I could get pointers I would try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants