Skip to content

Commit c27b71d

Browse files
committed
Removing default for CellRanger version based on feedback from EB
1 parent a6a9c41 commit c27b71d

2 files changed

Lines changed: 26 additions & 18 deletions

File tree

cellranger/Dockerfile_latest

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM ubuntu:24.04
55
# Build arguments for Cell Ranger version and download URL
66
# Users must obtain their own download URL from 10x Genomics after accepting
77
# their license agreement: https://www.10xgenomics.com/support/software/cell-ranger/downloads
8-
ARG CELLRANGER_VERSION=10.0.0
8+
ARG CELLRANGER_VERSION
99
ARG CELLRANGER_URL
1010

1111
# Adding labels for the GitHub Container Registry
@@ -21,7 +21,12 @@ LABEL org.opencontainers.image.licenses=MIT
2121
# Set the shell option to fail if any command in a pipe fails
2222
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2323

24-
# Validate that the download URL was provided
24+
# Validate that required build arguments were provided
25+
RUN if [ -z "${CELLRANGER_VERSION}" ]; then \
26+
echo "ERROR: CELLRANGER_VERSION build argument is required." && \
27+
echo "Example: --build-arg CELLRANGER_VERSION=10.0.0" && \
28+
exit 1; \
29+
fi
2530
RUN if [ -z "${CELLRANGER_URL}" ]; then \
2631
echo "ERROR: CELLRANGER_URL build argument is required." && \
2732
echo "Please obtain a download URL from 10x Genomics:" && \

cellranger/README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,34 @@ Since Cell Ranger requires accepting the 10x Genomics license agreement, you mus
3232
2. Accept the license agreement
3333
3. Copy the download URL for your desired version (e.g., `cellranger-10.0.0.tar.gz`)
3434

35-
> **Note:** Download URLs contain a signed key that expires. You will need to obtain a fresh URL each time you build.
35+
> **Note:** Each version has its own unique download URL with a signed key that expires. If you are building multiple versions, you will need a separate URL for each. You will also need to obtain a fresh URL each time the signed key expires.
3636
3737
### Step 2: Build the Image
3838

3939
The Dockerfile accepts two build arguments:
4040

41-
| Argument | Required | Default | Description |
42-
|---|---|---|---|
43-
| `CELLRANGER_URL` | Yes | | The signed download URL from 10x Genomics |
44-
| `CELLRANGER_VERSION` | No | `10.0.0` | The Cell Ranger version being installed |
41+
| Argument | Required | Description |
42+
|---|---|---|
43+
| `CELLRANGER_VERSION` | Yes | The Cell Ranger version to install (e.g., `10.0.0`, `6.0.2`) |
44+
| `CELLRANGER_URL` | Yes | The signed download URL from 10x Genomics |
4545

4646
```bash
47-
# Build the default version (10.0.0)
47+
# Example: build Cell Ranger 10.0.0
4848
docker build --platform linux/amd64 \
49+
--build-arg CELLRANGER_VERSION=10.0.0 \
4950
--build-arg CELLRANGER_URL="<your-download-url>" \
5051
-t cellranger:10.0.0 \
5152
-f cellranger/Dockerfile_latest .
5253

53-
# Build an older version
54+
# Example: build Cell Ranger 6.0.2
5455
docker build --platform linux/amd64 \
55-
--build-arg CELLRANGER_URL="<your-download-url>" \
5656
--build-arg CELLRANGER_VERSION=6.0.2 \
57+
--build-arg CELLRANGER_URL="<your-download-url>" \
5758
-t cellranger:6.0.2 \
5859
-f cellranger/Dockerfile_latest .
5960
```
6061

61-
The build will fail with an informative error if `CELLRANGER_URL` is not provided.
62+
The build will fail with an informative error if either argument is not provided.
6263

6364
## Usage
6465

@@ -98,41 +99,43 @@ If you or your organization would like to avoid rebuilding the image every time,
9899
```bash
99100
# Build the image (see "Building the Image" above)
100101
docker build --platform linux/amd64 \
102+
--build-arg CELLRANGER_VERSION=<your-version> \
101103
--build-arg CELLRANGER_URL="<your-download-url>" \
102-
-t ghcr.io/<your-org>/cellranger:10.0.0 \
104+
-t ghcr.io/<your-org>/cellranger:<your-version> \
103105
-f cellranger/Dockerfile_latest .
104106

105107
# Authenticate with GHCR using the GitHub CLI (recommended)
106108
gh auth refresh --scopes write:packages
107109
gh auth token | docker login ghcr.io -u USERNAME --password-stdin
108110

109111
# Push the image
110-
docker push ghcr.io/<your-org>/cellranger:10.0.0
112+
docker push ghcr.io/<your-org>/cellranger:<your-version>
111113

112114
# Pull from another machine
113-
docker pull ghcr.io/<your-org>/cellranger:10.0.0
115+
docker pull ghcr.io/<your-org>/cellranger:<your-version>
114116

115117
# Or with Apptainer (requires Apptainer v1.1.0+)
116118
gh auth refresh --scopes read:packages
117119
export APPTAINER_DOCKER_USERNAME=<your-github-username>
118120
export APPTAINER_DOCKER_PASSWORD=$(gh auth token)
119-
apptainer pull docker://ghcr.io/<your-org>/cellranger:10.0.0
121+
apptainer pull docker://ghcr.io/<your-org>/cellranger:<your-version>
120122
```
121123

122124
### Push to DockerHub (Private Repository)
123125

124126
```bash
125127
# Build the image
126128
docker build --platform linux/amd64 \
129+
--build-arg CELLRANGER_VERSION=<your-version> \
127130
--build-arg CELLRANGER_URL="<your-download-url>" \
128-
-t <your-username>/cellranger:10.0.0 \
131+
-t <your-username>/cellranger:<your-version> \
129132
-f cellranger/Dockerfile_latest .
130133

131134
# Log in to DockerHub
132135
docker login -u <your-username>
133136

134137
# Push the image (make sure the repo is set to private on DockerHub)
135-
docker push <your-username>/cellranger:10.0.0
138+
docker push <your-username>/cellranger:<your-version>
136139
```
137140

138141
> **Important:** Ensure your registry repository is set to **private** to comply with 10x Genomics' licensing terms. Do not distribute Cell Ranger images publicly.
@@ -151,7 +154,7 @@ apptainer remote login --username <your-github-username> docker://ghcr.io
151154
Alternatively, you can pre-pull the image before running the workflow so Apptainer uses the cached SIF file instead of pulling at runtime:
152155

153156
```bash
154-
apptainer pull cellranger_10.0.0.sif docker://ghcr.io/<your-org>/cellranger:10.0.0
157+
apptainer pull cellranger_<your-version>.sif docker://ghcr.io/<your-org>/cellranger:<your-version>
155158
```
156159

157160
## Dockerfile Structure

0 commit comments

Comments
 (0)