# Bioconductor base image gives us access to a lot of bioinformatics tools and R packages.
FROM bioconductor/bioconductor_docker:RELEASE_3_17
# Shell options, we want to exit if any command fails
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Root permissions are required to install packages
USER root
# Install any UNIX packages you need
# First we update the package list and then install GNU make
# We clean up after ourselves to reduce the image size
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Seurat and harmony
RUN Rscript -e 'install.packages(c("Seurat","harmony"))'
# Check if installs worked
RUN Rscript -e 'lapply(c("Seurat","harmony"), library, character.only = TRUE)'
# Run container as non-root to avoid permission issues
RUN groupadd -g 10001 notroot && \
useradd -u 10000 -g notroot notroot
# Switch to the non-root user
USER notroot:notroot
# Default command to run when the container starts
CMD ["/bin/bash"]
# Copy dockerfile into the image (optional, but can be useful for reproducibility)
COPY Dockerfile /Dockerfile