Skip to content
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

Updated tutorial for Docker and Singularity for Linux #1833

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from 1 commit
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
68 changes: 60 additions & 8 deletions docs/tutorial_docker.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,62 @@
# Pulling and running FragPipe using Docker

- Install docker by following the [instruction](https://docs.docker.com/desktop/install/mac-install/)
- Open terminal and pull the docker image: `docker pull fcyucn/fragpipe`
- (optional) Check the pulled image: `docker image ls -a`
- Create a Docker container: `docker run -it -v <host directory>:<container directory> fcyucn/fragpipe /bin/bash`. `<host directory>` is the directory in your host machine, and `<container directory>` is the directory you want to map the host directory to container.
- Then, you have entered the docker, and FragPipe is located in `/fragpipe_bin`
- Go to `/fragpipe_bin/fragPipe-x.x/fragpipe/bin` directory and execute `./fragpipe --help` in the terminal
# Running FragPipe using Docker and Singularity

This tutorial covers how to use **Docker** and **Singularity** to run FragPipe. We will run the `fcyucn/fragpipe:<version>` container, first with Docker, then converting it to a Singularity image.

## Prerequisites for Docker and Apptainer (Linux)

Before setting up Docker and Apptainer on Linux, ensure the following:

- **Operating System**: A Linux distribution (e.g., Ubuntu, CentOS, Debian).
- **Docker Installation**: Install Docker by following the [official guide for Linux](https://docs.docker.com/engine/install/).
- **Apptainer Installation**: Install Apptainer from the [Apptainer documentation](https://apptainer.org/docs/admin/main/installation.html).
- **Using Singularity Commands**: Apptainer supports Singularity commands. After installation, you can use `singularity` as the command-line interface (`apptainer` binary serves as `singularity`).

- **User Privileges**: Ensure you have `sudo` privileges for installation.

## Running FragPipe with Docker

1. **Pull and run the Docker container:**

To run the FragPipe tool directly using Docker, execute:

```bash
docker run fcyucn/fragpipe:<version> fragPipe-<version>/fragpipe/bin/fragpipe --help
```

This command will:
- Pull the `fcyucn/fragpipe:<version>` image from Docker Hub.
- Run the `fragpipe` command inside the container, displaying the help options.

2. **Save the Docker image to a TAR file:**

To convert the Docker container for use in Singularity, save the Docker image to a tarball:

```bash
docker save -o fragPipe-<version>.tar fcyucn/fragpipe:<version>
```

This command will export the Docker image into a file called `fragPipe-<version>.tar`.

## Running FragPipe with Singularity

1. **Convert the Docker image to a Singularity image:**

Use the exported Docker tarball to create a Singularity image:

```bash
singularity build fragPipe-<version>.img docker-archive://fragPipe-<version>.tar
```

This will convert the Docker image into a Singularity image named `fragPipe-<version>.img`.

2. **Run the FragPipe tool with Singularity:**

Once the Singularity image is built, you can execute the `fragpipe` command with:

```bash
singularity exec fragPipe-<verison>.img /fragpipe_bin/FragPipe-<version>/fragpipe/bin/fragpipe --help
```

This command runs the same `fragpipe` tool using the Singularity image, displaying the help options.

Read more: Check [Running FragPipe in command line interface](https://fragpipe.nesvilab.org/docs/tutorial_headless.html) for the instructions running FragPipe in command line interface.