# Adding a custom private library to catalog

**URL:** <https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166>\
**Category:** Rancher 1.x\
**Created:** [June 19, 2016, 7:59pm UTC](https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166 "2016-06-19T19:59:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![siminm](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/siminm/32/66_2.png) [@siminm](https://forums.suse.com/u/siminm)\
**Post date:** [June 19, 2016, 7:59pm UTC](https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166/1 "2016-06-19T19:59:31Z")

</div>

Is there a way to create a custom, private library (aka templates) to add to the catalog?

For example I’d like to allow employees at my company to quickly spin up stack with a predefined set of services, how they’re linked, some default env variables etc. But I don’t want to make this a public template. In fact some of the service docker images refer to a private hub, which wouldn’t work for public anyway.

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [June 19, 2016, 9:08pm UTC](https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166/2 "2016-06-19T21:08:53Z")

</div>

Yes, we have docs on how to create your own private catalog. Whatever URL you use to add your catalog into Rancher just needs to `git clone` to be able to handle.

[http://docs.rancher.com/rancher/latest/en/catalog/#creating-private-catalogs](http://docs.rancher.com/rancher/latest/en/catalog/#creating-private-catalogs)

---

<div class="post-metadata">

**Author:** ![siminm](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/siminm/32/66_2.png) [@siminm](https://forums.suse.com/u/siminm)\
**Post date:** [June 20, 2016, 12:03am UTC](https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166/3 "2016-06-20T00:03:30Z")

</div>

Thanks! I didn’t find it myself ☹

The documentation says:

> The URL needs to one that git clone can handle.

But it doesn’t explain how to handle private repos. Any way to add an SSH key to Rancher to be able to clone from private repos?

---

<div class="post-metadata">

**Author:** ![bengerman](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/bengerman/32/1127_2.png) [@bengerman](https://forums.suse.com/u/bengerman)\
**Post date:** [June 20, 2016, 5:19pm UTC](https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166/4 "2016-06-20T17:19:49Z")

</div>

Just did this myself, though I don’t know that Rancher officially supports it.

For myself, to make it easy, I temporarily disabled auth on our private repo and set it up with plain http.  
Then I exec’d into the running rancher-server container and created an ssh keypair. I updated the git config file directly to switch to ssh (the repos are in /var/log/cattle/DATA/) then did one manual git pull so I could accept the host key.

edit:  
To clarify, I disabled authentication on my repo so I could figure out where the repo ends up. You can do this without disabling authentication:

1. exec into your rancher server container (`docker exec -i -t <container-id> /bin/sh`)
2. `ssh-keygen`
3. provide id\_rsa.pub to your git repo
4. `cd /var/lib/cattle/DATA`
5. `mkdir <catalog-alias>`
6. `git clone <your repo> <catalog-alias>`
7. add the git repo to Rancher via the webUI using the same catalog alias and git URI you used above.

They do have a feature request open to support this directly:

> <https://github.com/rancher/rancher/issues/3248>

---

<div class="post-metadata">

**Author:** ![siminm](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/siminm/32/66_2.png) [@siminm](https://forums.suse.com/u/siminm)\
**Post date:** [June 20, 2016, 5:45pm UTC](https://forums.suse.com/t/adding-a-custom-private-library-to-catalog/3166/5 "2016-06-20T17:45:34Z")

</div>

Thanks! I ended up doing this also. Very curious if upgrading my rancher master container will retain this config, but TBH it’s not that hard to re-do if it breaks.

Added my +1 to issue #3248
