Skip to content

Commit 121aa24

Browse files
committed
Now uses miniconda3 for installation of R and R packages
1 parent 88a416c commit 121aa24

File tree

1 file changed

+25
-31
lines changed

1 file changed

+25
-31
lines changed

Dockerfile

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
1-
FROM debian:11.3-slim
2-
3-
MAINTAINER Matt Eldridge "matthew.eldridge@cruk.cam.ac.uk"
4-
5-
RUN apt-get update
6-
RUN apt-get install -y build-essential
7-
RUN apt-get install -y libxml2-dev
8-
RUN apt-get install -y libssl-dev
9-
RUN apt-get install -y curl
10-
RUN apt-get install -y gdebi-core
11-
RUN apt-get clean
12-
13-
# install R (https://docs.rstudio.com/resources/install-r)
14-
ARG R_VERSION=4.2.0
15-
RUN curl -O https://cdn.rstudio.com/r/debian-11/pkgs/r-${R_VERSION}_1_amd64.deb
16-
RUN gdebi -n r-${R_VERSION}_1_amd64.deb
17-
RUN rm r-${R_VERSION}_1_amd64.deb
18-
RUN ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R
19-
RUN ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript
1+
FROM debian:11.6-slim
2+
3+
LABEL authors="Matt Eldridge" \
4+
version="1.1" \
5+
description="Base Docker image for Shiny applications"
6+
7+
RUN apt-get update && \
8+
apt-get install -y curl gdebi-core && \
9+
apt-get clean
2010

2111
# install Shiny server (https://www.rstudio.com/products/shiny/download-server/ubuntu)
2212
ARG SHINY_SERVER_VERSION=1.5.18.987-amd64
2313
RUN curl -O https://download3.rstudio.org/ubuntu-18.04/x86_64/shiny-server-${SHINY_SERVER_VERSION}.deb
2414
RUN gdebi -n shiny-server-${SHINY_SERVER_VERSION}.deb
2515
RUN rm shiny-server-${SHINY_SERVER_VERSION}.deb
2616

27-
# install R packages
28-
RUN R -e 'install.packages("shiny", repos = "https://cloud.r-project.org")'
29-
RUN R -e 'install.packages("shinyjs", repos = "https://cloud.r-project.org")'
30-
RUN R -e 'install.packages("bslib", repos = "https://cloud.r-project.org")'
31-
RUN R -e 'install.packages("rmarkdown", repos = "https://cloud.r-project.org")'
32-
RUN R -e 'install.packages("colourpicker", repos = "https://cloud.r-project.org")'
33-
RUN R -e 'install.packages("tidyverse", repos = "https://cloud.r-project.org")'
34-
RUN R -e 'install.packages("plotly", repos = "https://cloud.r-project.org")'
35-
RUN R -e 'install.packages("patchwork", repos = "https://cloud.r-project.org")'
36-
RUN R -e 'install.packages("DT", repos = "https://cloud.r-project.org")'
37-
RUN R -e 'install.packages("RSQLite", repos = "https://cloud.r-project.org")'
38-
3917
# ensure the user account that is running the shiny server process has write privilege for /var/lib/shiny-server
4018
RUN chmod ugo+rwx /var/lib/shiny-server
4119

20+
ARG CONDA_VERSION=py310_23.1.0-1
21+
ARG CONDA_SHA256=32d73e1bc33fda089d7cd9ef4c1be542616bd8e437d1f77afeeaf7afdb019787
22+
23+
RUN curl https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -o miniconda3.sh && \
24+
echo "${CONDA_SHA256} miniconda3.sh" > miniconda3.sha256 && \
25+
sha256sum -c miniconda3.sha256 && \
26+
mkdir -p /opt && \
27+
sh miniconda3.sh -b -p /opt/conda && \
28+
rm miniconda3.sh miniconda3.sha256
29+
30+
COPY conda.yml .
31+
32+
RUN /opt/conda/bin/conda env create -f conda.yml && /opt/conda/bin/conda clean -a
33+
34+
ENV PATH /opt/conda/envs/shiny_base/bin:$PATH
35+
4236
# expose port that Shiny server listens on (can be mapped to another port on the host)
4337
EXPOSE 3838
4438

0 commit comments

Comments
 (0)