Skip to content

Commit

Permalink
update installation link
Browse files Browse the repository at this point in the history
  • Loading branch information
jashapiro committed Aug 30, 2024
1 parent 60b1b2d commit c4248c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions analyses/doublet-detection/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ RUN curl -L "https://github.com/conda-forge/miniforge/releases/latest/download/M
&& echo ". /opt/conda/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc

# Install conda-lock
RUN conda install --channel=conda-forge --name=base conda-lock && conda clean --all --yes
RUN conda install --channel=conda-forge --name=base conda-lock \
&& conda clean --all --yes

# Install pandoc dependency
RUN apt-get -y update && \
Expand All @@ -49,6 +50,9 @@ COPY conda-lock.yml conda-lock.yml
RUN conda-lock install -n ${ENV_NAME} conda-lock.yml \
&& conda clean --all --yes

# Activate conda environment on bash launch
RUN echo "conda activate ${ENV_NAME}" >> ~/.bashrc

# Copy the renv.lock file from the host environment to the image
COPY renv.lock renv.lock

Expand All @@ -67,8 +71,5 @@ RUN Rscript -e "proc <- basilisk::basiliskStart(env = zellkonverter::zellkonvert
basilisk::basiliskStop(proc); \
basilisk.utils::cleanConda()"

# Activate conda environment on bash launch
RUN echo "conda activate ${ENV_NAME}" >> ~/.bashrc

# Set CMD to bash to activate the environment when launching
CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions docs/ensuring-repro/docker/docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ CMD ["/bin/bash"]
If your analysis module requires both R and conda environments, you may have to do just a bit more work to set up the Dockerfile, as there is not a single base image that includes both R and conda environments.
<!-- Should we make one, maybe? -->
We recommend starting with an R-based image and then installing conda manually.
In the example below, we have adapted the installation steps used in the [official Miniconda Dockerfile](https://github.com/ContinuumIO/docker-images/blob/main/miniconda3/debian/Dockerfile).
In the example below, we have adapted the installation steps used in the [official Miniforge Dockerfile](https://github.com/conda-forge/miniforge-images/blob/master/ubuntu/Dockerfile).

```Dockerfile
# Dockerfile for an analysis module with both R and conda environments
Expand All @@ -163,7 +163,8 @@ RUN curl -L "https://github.com/conda-forge/miniforge/releases/latest/download/M
&& echo ". /opt/conda/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc

# Install conda-lock
RUN conda install --channel=conda-forge --name=base conda-lock && conda clean --all --yes
RUN conda install --channel=conda-forge --name=base conda-lock \
&& conda clean --all --yes

# Install renv
RUN Rscript -e "install.packages('renv')"
Expand Down

0 comments on commit c4248c7

Please sign in to comment.