Skip to content

ENH: Create script to set up a development environment using docker #39936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
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