Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion doc/source/development/contributing_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ Instead of manually setting up a development environment, you can use `Docker
commands. pandas provides a ``DockerFile`` in the root directory to build a Docker image
with a full pandas development environment.

**Docker Commands**
**Unix/macOS**

There is a script to help you with this::

./scripts/docker.sh

When prompted, enter your Github username.

**Windows**

Pass your GitHub username in the ``DockerFile`` to use your own fork::

Expand Down
25 changes: 25 additions & 0 deletions scripts/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Set up a development environment with Docker.

run_container () {
# Run a container and bind the local forked repo to it
docker run -it --rm -v "$(pwd)":/home/pandas-"$USER" pandas-"$USER"-env
}

# Check if pandas image already exists
docker image ls | grep "pandas-$USER-env" &> /dev/null

if [[ $? == 0 ]]; then

run_container

else

# Pass the Github username as the build variable
read -rp "Github username: " gh_username
docker build --tag pandas-"$USER"-env --build-arg gh_username=$gh_username .

run_container

fi