Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Configuration files for repo2docker

Learning objectives

After this section, you will be able to:

repo2docker looks through a repository for configuration files which include information in the required software to run the code. In most cases, these are ordinary files already used by package managers .

Common examples include:

FileTypical use
requirements.txtPython packages installed with pip
install.RR package installation
apt.txtUbuntu system packages
runtime.txtRuntime version when the main environment file cannot express it
postBuildCommands to run after the environment has been installed

You normally do not need all of these files. You can start with the simplest minimal description that can reproduce your project.

For a small teaching repository, putting the configuration files at the top level keeps the structure easy to understand. repo2docker also supports a .binder/ directory for Binder-specific configuration.

A minimal Python repository might look like this:

my-project/
├── README.md
├── analysis.ipynb
└── requirements.txt

One environment definition is usually enough

More configuration is not automatically better. Some supported files take priority over others, and some combinations can cause one file to be ignored. For example, if the Python version is already specified in environment.yml, a Python version in runtime.txt is ignored.

When in doubt, check the current repo2docker documentation rather than combining several environment definitions.

Quick exercise

Further reading