-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathDockerfile
85 lines (71 loc) · 1.99 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Pulling Rocker image with RStudio and R version 4.2
FROM rocker/rstudio:4.2
# Setting environment variables
ARG CONDA_ENV=flex_dashboard
ENV CONDA_ENV=$CONDA_ENV
ARG PYTHON_VER=3.8
ENV PYTHON_VER=$PYTHON_VER
ARG QUARTO_VERSION=1.2.335
ENV QUARTO_VERSION=$QUARTO_VERSION
# Disabling the authentication step
ENV USER="rstudio"
CMD ["/usr/lib/rstudio-server/bin/rserver", "--server-daemonize", "0", "--auth-none", "1"]
# Install jq to parse json files
# Layer 6
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
libxml2-dev \
zlib1g \
g++-11 \
libz-dev \
freetype2-demos \
libpng-dev \
libtiff-dev \
libjpeg-dev \
make \
fontconfig \
libfribidi-dev \
libharfbuzz-dev \
libfontconfig1-dev \
git \
vim \
libgl1-mesa-glx \
libegl1-mesa \
libxrandr2 \
libxss1 \
libxcursor1 \
libxcomposite1 \
libasound2 \
libxi6 \
libxtst6 \
gpg-agent \
&& rm -rf /var/lib/apt/lists/*
# installing R packages
# Layer 7
RUN mkdir packages
# Layer 9-12
COPY install_packages.R packages/
COPY install_python.R packages/
COPY packages.json packages/
RUN Rscript packages/install_packages.R
# Installing Quarto
COPY install_quarto.sh packages/
RUN bash packages/install_quarto.sh $QUARTO_VERSION
# Install miniconda
RUN sudo apt update && apt-get install -y --no-install-recommends \
software-properties-common \
&& command sudo add-apt-repository -y ppa:deadsnakes/ppa \
&& sudo apt update
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh \
&& /bin/bash ~/miniconda.sh -b -p /opt/conda \
&& export PATH=/opt/conda/bin:$PATH \
&& conda init bash \
&& conda install conda-build
# Set environment
RUN . /root/.bashrc \
&& conda create -y --name $CONDA_ENV python=$PYTHON_VER
RUN echo "conda activate $CONDA_ENV" >> ~/.bashrc
RUN Rscript packages/install_python.R
# Add Rprofile with VScode settings
COPY .Rprofile ~/
EXPOSE 8787