# Can I use hub.initContainers or hub.extraContainers to add packages that would then be visible to JupyterHub?

**URL:** <https://discourse.jupyter.org/t/can-i-use-hub-initcontainers-or-hub-extracontainers-to-add-packages-that-would-then-be-visible-to-jupyterhub/2033>\
**Category:** JupyterHub\
**Created:** [September 1, 2019, 11:00pm UTC](https://discourse.jupyter.org/t/can-i-use-hub-initcontainers-or-hub-extracontainers-to-add-packages-that-would-then-be-visible-to-jupyterhub/2033 "2019-09-01T23:00:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mz2](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mz2/32/1056_2.png) [@mz2](https://discourse.jupyter.org/u/mz2)\
**Post date:** [September 1, 2019, 11:00pm UTC](https://discourse.jupyter.org/t/can-i-use-hub-initcontainers-or-hub-extracontainers-to-add-packages-that-would-then-be-visible-to-jupyterhub/2033/1 "2019-09-01T23:00:05Z")

</div>

I’m having trouble grasping how using the JupyterHub Helm chart I would add some packages needed by something I’d like to reference in `extraConfig`. There is a reference to `hub.extraContainers` in [https://z2jh.jupyter.org/en/latest/advanced.html#arbitrary-extra-code-and-configuration-in-jupyterhub-config-py](https://z2jh.jupyter.org/en/latest/advanced.html#arbitrary-extra-code-and-configuration-in-jupyterhub-config-py) but I can’t find an example from anywhere exactly explaining how this would work and whether this would perhaps help me solve the problem 'd like to ultimately solve: use the [JWT authenticator](https://github.com/mogthesprog/jwtauthenticator) that is not installed in the image that’s referenced in the jupyterhub helm chart).

Am I on the right track, or is it necessary for me to fork the Helm chart for my purposes?

Another possibility looks to be `initContainers`?

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 2, 2019, 1:51am UTC](https://discourse.jupyter.org/t/can-i-use-hub-initcontainers-or-hub-extracontainers-to-add-packages-that-would-then-be-visible-to-jupyterhub/2033/2 "2019-09-02T01:51:51Z")

</div>

Your best option is to build your own hub image, push it to a registry, and reference it in your config:  
[https://z2jh.jupyter.org/en/latest/reference.html#hub-image](https://z2jh.jupyter.org/en/latest/reference.html#hub-image)

You can see the Dockerfile for the default hub image here: [https://github.com/jupyterhub/zero-to-jupyterhub-k8s/tree/master/images/hub](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/tree/master/images/hub)

There’s no need to fork the chart.

---

<div class="post-metadata">

**Author:** ![mz2](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mz2/32/1056_2.png) [@mz2](https://discourse.jupyter.org/u/mz2)\
**Post date:** [September 2, 2019, 8:44am UTC](https://discourse.jupyter.org/t/can-i-use-hub-initcontainers-or-hub-extracontainers-to-add-packages-that-would-then-be-visible-to-jupyterhub/2033/3 "2019-09-02T08:44:59Z")

</div>

Thanks, this had gone past me in the docs, makes a lot of sense!

---

<div class="post-metadata">

**Author:** ![mz2](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mz2/32/1056_2.png) [@mz2](https://discourse.jupyter.org/u/mz2)\
**Post date:** [September 3, 2019, 5:15pm UTC](https://discourse.jupyter.org/t/can-i-use-hub-initcontainers-or-hub-extracontainers-to-add-packages-that-would-then-be-visible-to-jupyterhub/2033/4 "2019-09-03T17:15:11Z")

</div>

I can confirm that setting a custom image worked like charm.
