Customizing the Environment

You can customize your tale environment by declaring any software dependencies in a set of simple text files. These are used to build a Docker image that is used to run your code.

The text file formats are based on formats supported by repo2docker and, where possible, follow package installation conventions of each language (e.g., requirements.txt for Python, DESCRIPTION for R). In other cases, simple formats are defined (e.g., apt.txt, toolboxes.txt). For more information, see the the repo2docker configuration files documentation.

Base environment

The base environment is always an Ubuntu “Long Term Support” (LTS) version.

Install Linux packages (via apt)

The apt.txt file contains a list of packages that can be installed via apt-get. Entries may have an optional version (e.g., for use with apt-get install <package name>=<version>)

For example:

libblas-dev=3.7.1-4ubuntu1
liblapack-dev=3.7.1-4ubuntu1

For more information, see Install packages with apt-get (repo2docker)

MATLAB

Note

MATLAB support is part of the Whole Tale repo2docker extension.

MATLAB toolboxes must be declared in a toolboxes.txt file. Each line contains a valid MATLAB product for the selected version.

For a complete list of available packages for each supported version, see https://github.com/whole-tale/matlab-install/blob/main/products/.

For example the following toolboxes.txt wold install the Financial and Statistics and Machine Learning toolboxes.

product.Financial_Toolbox
product.Statistics_and_Machine_Learning_Toolbox

See our MATLAB example

STATA

Note

STATA support is part of the Whole Tale repo2docker extension.

STATA packages must be declared in a install.do file. Each line contains a valid installation command.

For example the following install.do uses ssc to install packages:

ssc install estout
ssc install boottest
ssc install hnblogit

R/RStudio

R packages may be specified in a DESCRIPTION file or install.R.

For install.R, each line is an install.packages() statement for a given package:

install.packages("ggplot2")
install.packages("reshape2")
install.packages("lmtest")

To configure a specific version, we recommend configuring an MRAN date using the runtime.txt file:

r-2020-10-20

This file contains the MRAN date containing the versions of packages specified in install.R.

Alternatively, you ca use the install_version function in place of install.packages in your install.R file.

require(devtools)
install_version("ggplot2", version = "0.9.1")

For more information see:

Python

Python packages can be specified using requirements.txt, Pipfile/Pipfile.lock, or Conda environment.yml.

Example requirements.txt:

bokeh==1.4.0
pandas==1.2.4
xlrda==2.0.1

See also:

Environment Variables

In addition to using the start file below, you can specify custom environment variables using the advanced settings.

Other

Non-standard packages can be installed (or arbitrary commands run) using a postBuild script. The start script can be used to run arbitrary code before th user session starts.

Important

The start file is currently not supported in RStudio environments.

See also: