|
| 1 | +# Dockerfile for the `satijalab/seurat-ci` image, intended for running CI |
| 2 | +# workflows for https://github.com/satijalab/seurat and its related projects |
| 3 | +# (e.g. https://github.com/satijalab/seurat-object). |
| 4 | + |
| 5 | +# Use `rocker/r2u` as the base image. |
| 6 | +# The r2u Project provides precompiled Ubuntu binaries for all CRAN packages |
| 7 | +# and their BioConductor dependencies accessible via `apt`. With `bspm` enabled, |
| 8 | +# calls to `install.packages` can also take advantage of this configuration. |
| 9 | +# The main advantage of this setup is that installs are faster and more |
| 10 | +# reliable. The downside is that since r2u only makes precompiled binaries |
| 11 | +# available for R-release, this setup is not compatible with any other versions |
| 12 | +# of R. See https://eddelbuettel.github.io/r2u/ for more details. |
| 13 | +FROM rocker/r2u:jammy |
| 14 | + |
| 15 | +# Set a CTAN mirror and add `texlive` to the PATH. |
| 16 | +ENV CTAN_REPO="https://mirror.ctan.org/systems/texlive/tlnet" |
| 17 | +ENV PATH="$PATH:/usr/local/texlive/bin/linux" |
| 18 | + |
| 19 | +# In addition to `rocker/r2u` images, the Rocker Project also provides a |
| 20 | +# set of images that comes with a set of shared setup scripts providing tools |
| 21 | +# from `pandoc` and `texlive` to `python` and `CUDA`, for more details, see |
| 22 | +# https://github.com/rocker-org/rocker-versioned2?tab=readme-ov-file#rocker-scripts. |
| 23 | +# |
| 24 | +# Using multi-stage builds we can pull these scripts direclty from the |
| 25 | +# `rocker/r-ver` image and use them to install the things we need. |
| 26 | +# |
| 27 | +# TODO: consider vendorizing rocker_scripts/ directy into seurat-docker |
| 28 | +# and introducing a workflow to keeps its contents in sync with |
| 29 | +# https://github.com/rocker-org/rocker-versioned2/tree/master/scripts. |
| 30 | +COPY --from=rocker/r-ver:latest /rocker_scripts/bin/ /rocker_scripts/bin/ |
| 31 | +COPY --from=rocker/r-ver:latest /rocker_scripts/install_pandoc.sh /rocker_scripts/install_pandoc.sh |
| 32 | +COPY --from=rocker/r-ver:latest /rocker_scripts/install_texlive.sh /rocker_scripts/install_texlive.sh |
| 33 | +RUN apt update \ |
| 34 | + && apt install -y --no-install-recommends \ |
| 35 | + # System dependencies not covered by the copied scripts. |
| 36 | + texinfo \ |
| 37 | + tidy \ |
| 38 | + # R packages (brought to you by r2u). |
| 39 | + r-cran-devtools \ |
| 40 | + r-cran-plotly \ |
| 41 | + r-cran-v8 \ |
| 42 | + # The `install2.r` script comes from the `littler` package and is included |
| 43 | + # under `/usr/local/bin/` by the base image. The version found under |
| 44 | + # `/rocker_scripts/bin/install2.r` differs from the `littler` version in |
| 45 | + # two ways: |
| 46 | + # 1. It does not provide a `--type` flag |
| 47 | + # 2. It exposes an additional `--skipmissing` flag |
| 48 | + # Neither flag is actually used in the following scripts but it's probably |
| 49 | + # best to make sure that we're using the intended version just to be safe. |
| 50 | + && ln -sf /rocker_scripts/bin/install2.r /usr/local/bin/install2.r \ |
| 51 | + && /rocker_scripts/install_pandoc.sh \ |
| 52 | + && /rocker_scripts/install_texlive.sh |
| 53 | + |
| 54 | +# Install `BPCells`. Since it is not available on CRAN or BioConductor, the |
| 55 | +# package needs to be installed from source. This is quite slow, hence why |
| 56 | +# this is the only `Seurat` dependency being explicitly pre-installed. |
| 57 | +RUN apt update \ |
| 58 | + && apt install -y libhdf5-dev \ |
| 59 | + && Rscript -e 'install.packages("BPCells", repos = "https://bnprks.r-universe.dev")' |
| 60 | + |
| 61 | +# Set environment variables to suppress NOTEs that are accepted by CRAN, see |
| 62 | +# https://www.rdocumentation.org/packages/rcmdcheck/versions/1.4.0/topics/rcmdcheck |
| 63 | +# for more details. |
| 64 | +ENV _R_CHECK_PKG_SIZES_="false" |
| 65 | +ENV _R_CHECK_RD_XREFS_="false" |
| 66 | +ENV _R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_="false" |
| 67 | +ENV _R_CHECK_PACKAGE_DATASETS_SUPPRESS_NOTES_="true" |
| 68 | + |
| 69 | +# Remove scripts copied from `rocker/r-ver` and point /usr/local/bin/install2.r |
| 70 | +# back to the littler version. |
| 71 | +RUN ln -sf /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \ |
| 72 | + && rm -rf /rocker_scripts/ |
0 commit comments