Post-Install Script

The Post-Install script is a customized bash script to install complex packages that are unavailable through a package manager, may require building from source, or that need a precisely specified order of operations. For these use cases, use the postInstall script. Here, you can run any commands that you could run on a Linux system (e.g., curl , unzip /tar , or git clone ). It is found below the package managers in the Environment editor.

Since the script will be run as part of the build phase, any command will be run once, and will then be cached as part of your Capsule's custom environment.

A few things to note:

  • Many software installation instructions will specify commands such as sudo apt-get install python-dev; sudo is neither necessary nor available on Code Ocean and can simply be omitted.

  • PostInstall script cannot access/code or /data folders.

  • Referring folder built in the postInstall script:

    • The working directory for the postInstall script is / (root), which means if you include a command like mkdir mylibrary to create a folder, when you later need to refer to that folder, it will be available at /mylibrary.

    • The/opt folder can be accessed from the postInstall script and reproducible runs. Therefore, you can use /opt folder to keep source or downloaded files and configure the package. Then add /opt to the path and use the package in a reproducible run.

  • The Environment folder has a 100MB size limit.