Get started#
This tutorial guides you through installing repo2docker and building your first environment image.
Prerequisite#
Python#
repo2docker requires Python 3.6 or above.
Container Engine#
repo2docker requires a container engine compatible with the specification published by the Open Container Initiative.
Docker#
Important
Only the Docker Engine is open source. Docker Desktop requires a license.
Podman#
Follow Podman’s official installation steps.
After completing the installation of Podman,
create a listening service for Podman by running
systemctl --user start podman.socket
configure the
DOCKER_HOSTenvironment variable following Podman’s official procedure. You might want to configure theDOCKER_HOSTenvironment variable to persist in your~/.bashrc.
Install repo2docker#
Install repo2docker with pip#
It is recommend to install repo2docker with the pip tool:
python3 -m pip install jupyter-repo2docker
Build a repository with repo2docker#
Now that you’ve installed a container engine and repo2docker, you can build a repository.
To do so, continue following this guide.
Start the container engine#
Ensure that the container engine is running.
Docker#
Follow the offcial instructions for starting Docker.
Podman#
Run
podman info
Build an image from a URL#
Next we’ll build a reproducible image from a URL. We’ll use the Binder requirements.txt example, which installs a simple Python environment. Run the following command:
jupyter-repo2docker https://github.com/binder-examples/requirements
You’ll see repo2docker take the following actions:
Inspect the repository for configuration files. It will detect the
requirements.txtfile in the repository.Build a container image using the configuration files. In this case, the
requirements.txtfile will correspond to a Python environment.Run the image to let you explore the repository interactively.
Click the link provided and you’ll be taken to an interactive Jupyter Notebook interface where you can run commands interactively inside the environment.
Learn more#
This is a simple example building an environment image for your repository.
To learn more about the kinds of source repositories, environments, and use-cases that repo2docker supports, see the repo2docker user guide.