Go Client and Pushing to a Restricted Registry

I’m stuck on a problem. I’m pushing to an AWS ECR repository and it is not clear how to set credentials along with the client.ImagePush function. I thought it I set the RegistryAuth as the base64 string in ImagePushOptions

This would need moving some functions from docker/cli to moby/moby/client.

I had once tried that ( https://github.com/moby/moby/pull/30817 ).

I’ll reopen the PR.

Explain. Is my problem just because the feature isn’t imported?

Yes, you could push to a restricted registry by just importing some functions from docker/cli.

After discussion at https://github.com/moby/moby/pull/30817#issuecomment-307881740, these functions are decided to continue to exist at docker/cli, but it will be decoupled from DockerCli structure, and will be easy to import for 3rd parties.

opened https://github.com/docker/cli/pull/197