Skip to content

Setting Up Binder Development

Joe McLaughlin edited this page Nov 5, 2024 · 6 revisions

Follow these instructions to get Binder running locally on your computer for testing and development!

This guide assumes you are familiar with creating folders in your operating system's terminal and have git installed (Run git --version from the command line to check)

Fork and clone the Binder repository on Github

Fork Binder using the "Fork" Button in the top right of the Github screen, and clone your forked repository

git clone https://github.com/link_to/your_binder

Set up dependencies for Binder development

Binder uses Docker to manage dependencies and make setting up your development environment easier! If you don't already have docker on your computer, visit https://www.docker.com/ to download Docker Desktop.

Then, before the first time running Binder you need to build the Binder Docker image that includes all of the code and dependencies required to run Binder using

docker-compose build.

Run Binder Locally

Windows:

Once the Binder Docker image has been built, start the Binder image by running

docker-compose up --watch

After a few seconds, Binder should be running at http://localhost:3000/!

Note: After you've closed Binder (Using Ctrl+C), be sure to run

docker-compose down

to close the Docker container.

MacOS or Linux:

Once the Binder Docker image has been built, start the Binder image by running

./run.bash

Note that if you get a "Permission Denied" error, you may need to run chmod +x run.bash and try again.

Run Other Rails Commands

Occasionally, we want to run other commands related to Binder for testing (e.g. rails console). You can run any traditional rails command by running

docker-compose exec web COMMAND_NAME.

For MacOS or Linux users, we also have a binder bash script to run rails commands easily. Simply run

./binder [command to run]

to run the command. Note that if you get a "Permission Denied" error, you may need to run chmod +x run.bash and try again.