-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (53 loc) · 2.08 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (53 loc) · 2.08 KB
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
# STAGE 0 - Ubuntu packages and R repository
FROM ubuntu as stage0
RUN echo "America/New_York" | tee /etc/timezone \
&& apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y \
build-essential \
gcc \
gfortran \
locales \
libcurl4-gnutls-dev \
libfontconfig1-dev \
libfribidi-dev \
libgit2-dev \
libharfbuzz-dev \
libnetcdf-dev \
libnetcdff-dev \
libssl-dev \
libtiff5-dev \
libxml2-dev \
tzdata \
wget \
&& locale-gen en_US.UTF-8
# STAGE 1 - R and R packages
FROM stage0 as stage1
RUN apt-get update
RUN apt -y install \
software-properties-common \
dirmngr \
&& . /etc/lsb-release \
&& wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \
&& add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" \
&& apt install -y \
r-base \
r-base-dev \
&& /usr/bin/Rscript -e "install.packages('RNetCDF', dependencies=TRUE, repos='http://cran.rstudio.com/')" \
&& /usr/bin/Rscript -e "install.packages('rjson', dependencies=TRUE, repos='http://cran.rstudio.com/') "\
&& /usr/bin/Rscript -e "install.packages('dplyr', dependencies=TRUE, repos='http://cran.rstudio.com/')" \
&& /usr/bin/Rscript -e "install.packages('reticulate', dependencies=TRUE, repos='http://cran.rstudio.com/')" \
&& /usr/bin/Rscript -e "install.packages('optparse', dependencies=TRUE, repos='http://cran.rstudio.com/')"
# STAGE 2 - Python and python packages for S3 functionality
FROM stage1 as stage2
RUN apt update && apt -y install python3 python3-dev python3-pip python3-venv python3-boto3
# STAGE 3 set up I/O directories, copy geobamdata installer and R script
FROM stage2 as stage3
COPY ./prediagnostics/ /app/prediagnostics/
COPY ./sos_read /app/prediagnostics/sos_read/
# STAGE 4 - Execute algorithm
FROM stage3 as stage4
LABEL version="1.0" \
description="Containerized prediagnostics module." \
"confluence.contact"="ntebaldi@umass.edu" \
"algorithm.contact"="cjgleason@umass.edu"
ENTRYPOINT [ "/usr/bin/Rscript", "/app/prediagnostics/run_prediagnostics.R" ]