# Go Client and Pushing to a Restricted Registry

**URL:** <https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61>\
**Category:** Support\
**Created:** [June 10, 2017, 10:04pm UTC](https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61 "2017-06-10T22:04:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdgiotta](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.mobyproject.org/jdgiotta/32/61_2.png) [@jdgiotta](https://forums.mobyproject.org/u/jdgiotta)\
**Post date:** [June 10, 2017, 10:04pm UTC](https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61/1 "2017-06-10T22:04:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AkihiroSuda](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.mobyproject.org/akihirosuda/32/213_2.png) [@AkihiroSuda](https://forums.mobyproject.org/u/AkihiroSuda)\
**Post date:** [June 12, 2017, 4:57am UTC](https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61/2 "2017-06-12T04:57:10Z")

</div>

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](https://github.com/moby/moby/pull/30817) ).

I’ll reopen the PR.

---

<div class="post-metadata">

**Author:** ![jdgiotta](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.mobyproject.org/jdgiotta/32/61_2.png) [@jdgiotta](https://forums.mobyproject.org/u/jdgiotta)\
**Post date:** [June 14, 2017, 12:49am UTC](https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61/3 "2017-06-14T00:49:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AkihiroSuda](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.mobyproject.org/akihirosuda/32/213_2.png) [@AkihiroSuda](https://forums.mobyproject.org/u/AkihiroSuda)\
**Post date:** [June 14, 2017, 6:31am UTC](https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61/4 "2017-06-14T06:31:42Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![AkihiroSuda](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.mobyproject.org/akihirosuda/32/213_2.png) [@AkihiroSuda](https://forums.mobyproject.org/u/AkihiroSuda)\
**Post date:** [June 15, 2017, 6:02am UTC](https://forums.mobyproject.org/t/go-client-and-pushing-to-a-restricted-registry/61/5 "2017-06-15T06:02:42Z")

</div>

opened [https://github.com/docker/cli/pull/197](https://github.com/docker/cli/pull/197)
