# Four ways to use `repo2docker` images in a JupyterHub
Many users of `repo2docker` primarily wish to define the environment for a Binder or a JupyterHub. Here are four ways to accomplish this, from least-to-most work.
% TO EDIT THIS FIGURE: Load the linked SVG into excalidraw.com, make edits, and re-export.
```{figure} ../_static/images/whentouse.svg
A decision tree for the recommended way to get your reproducible user environment using `repo2docker` or a community image built with `repo2docker`.
```
## 1. Use a community maintained image
The simplest thing to do is check whether another community already maintains and offers an image that you can simply re-use. This reduces the burden on you to keep the image up-to-date, and gives you an opportunity to collaborate and make contributions rather than building something yourself from scratch.
See [](./community-image.md) for a brief how-to on using a community maintained image.
::::{grid} 2
:::{grid-item-card} Benefits
- A community of experts maintains the image with you!
- Don’t struggle alone with your problems, drag others along!
- Good choices (base image, how python is installed, etc) made on your behalf
- Updates happen without you needing to do much
:::
:::{grid-item-card} Drawbacks
- Might have lots of stuff you don’t need
- Large image sizes, slower pulling
- Might get you 98% of the way there, but that isn't 100%
- Architectural choices made might not fit your use case
- Updates are not on your schedule
:::
::::
## 2. Inherit from a community maintained image and add a few extras
Sometimes a community-maintained environment image has **almost** what you need, but there are a few extra packages you'd like to install yourself. In this case, it's easiest to **inherit and extend the community image**.
This is not the same thing as forking the repository for the community image, modifying it, and re-building it from scratch. It's similar to depending on an upstream piece of software and then building upon it in your own tool.
If your needs differ far enough from the community-maintained images that you find, you can use `repo2docker` to build your environment image using [supported configuration files](#config-files).
To learn how to do this, follow the [getting started with repo2docker guide](../start.md) and look at the [list of supported configuration files](#config-files).
Check out the other sections under "Image building basics" for more useful how-tos.
If you need full control over the entire computational environment, you can always create your own `Dockerfile` from scratch, and `repo2docker` will build an image out of it.