Skip to content

Commit 11c5f1e

Browse files
authored
Merge pull request #91 from ku-selene/master
Add Docker Support for BugsInPy
2 parents 38afff7 + 68cb84e commit 11c5f1e

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.12-slim-trixie
2+
3+
# The installer requires curl (and certificates) to download the release archive
4+
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git dos2unix vim
5+
6+
# Download the latest installer
7+
ADD https://astral.sh/uv/install.sh /uv-installer.sh
8+
9+
# Run the installer then remove it
10+
RUN sh /uv-installer.sh && rm /uv-installer.sh
11+
12+
# Ensure the installed binary is on the `PATH`
13+
ENV PATH="/root/.local/bin/:$PATH"
14+
ENV BUGSINPY_HOME="/home/bugsinpy/"
15+
ENV PATH="$BUGSINPY_HOME/framework/bin:$PATH"
16+
17+
# Set working directory
18+
WORKDIR /home
19+
20+
# Default command
21+
CMD ["bash"]

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ The objective of this work is to support reproducible research on real-world Pyt
88
2. Add BugsInPy executables path:
99
- `export PATH=$PATH:<bugsinpy_path>/framework/bin`
1010

11+
# Use Docker
12+
Clone the repository, build the Docker image, and start a container:
13+
14+
```shell
15+
docker build -t bugsinpy .
16+
docker run -dt \
17+
-v ./framework:/home/bugsinpy/framework \
18+
-v ./projects:/home/bugsinpy/projects \
19+
-v ./workspace:/home/workspace
20+
--name {your_container_name} bugsinpy
21+
docker exec -it {your_container_name} bash
22+
```
23+
Replace `{your_container_name}` with your preferred container name.
24+
When working inside the container, if you checkout source code to `/home/workspace/`, it will be accessible on your host machine at `./workspace` due to the mounted volume. For example:
25+
26+
```shell
27+
bugsinpy-checkout -p youtube-dl -v 0 -i 2 -w /home/workspace
28+
```
29+
30+
This command checks out the specified bug to `/home/workspace` in the container, which corresponds to `./workspace` on your host.
31+
1132
# BugsInPy Command
1233
Command | Description
1334
--- | ---

0 commit comments

Comments
 (0)