-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathDockerfile
197 lines (182 loc) · 5.28 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
FROM gds_py:latest
#FROM darribas/gds_py:4.1
MAINTAINER Dani Arribas-Bel <D.Arribas-Bel@liverpool.ac.uk>
# https://github.com/ContinuumIO/docker-images/blob/master/miniconda3/Dockerfile
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
USER root
# Remove Conda from path to not interfere with R install
RUN echo ${PATH}
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
RUN echo ${PATH}
#--- Utilities ---#
RUN add-apt-repository -y ppa:ubuntugis/ubuntugis-experimental \
&& apt-get update -qq \
&& apt-get install -y --no-install-recommends \
# General
# https://github.com/rocker-org/rocker-versioned2/blob/538743fcf4940b03d22e1625c7024b3304244ca2/scripts/install_R_ppa.sh
ca-certificates \
less \
libopenblas-base \
locales \
dirmngr \
gpg \
gpg-agent \
# TidyVerse
# https://github.com/rocker-org/rocker-versioned2/blob/538743fcf4940b03d22e1625c7024b3304244ca2/scripts/install_tidyverse.sh
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
unixodbc-dev \
# ---------
# Geospatial
# https://github.com/rocker-org/rocker-versioned2/blob/65309d4d9dac11d3a78dd26ee4bf7b715436db31/scripts/install_geospatial.sh
lbzip2 \
libfftw3-dev \
libgdal-dev \
libgeos-dev \
libgsl0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libhdf4-alt-dev \
libhdf5-dev \
libjq-dev \
libpq-dev \
libproj-dev \
libprotobuf-dev \
libnetcdf-dev \
libsqlite3-dev \
libssl-dev \
libudunits2-dev \
lsb-release \
netcdf-bin \
postgis \
protobuf-compiler \
sqlite3 \
tk-dev \
unixodbc-dev \
# ---------
# Other
gpg-agent \
jq \
libatk1.0-0 \
liblwgeom-dev \
libv8-3.14-dev \
libx11-6 \
libxtst6 \
wget \
# ---------
&& apt-get autoclean \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
#--- R ---#
# https://github.com/rocker-org/rocker-versioned/blob/master/r-ver/Dockerfile
# Look at: http://sites.psu.edu/theubunturblog/installing-r-in-ubuntu/
RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/" >> /etc/apt/sources.list \
&& sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
&& apt-get update \
&& apt-get install -y \
r-base \
r-base-dev \
&& apt-get autoclean \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN R -e "install.packages(c( \
# ------------------
# TidyVerse
# https://github.com/rocker-org/rocker-versioned2/blob/538743fcf4940b03d22e1625c7024b3304244ca2/scripts/install_tidyverse.sh
'BiocManager', \
'devtools', \
'rmarkdown', \
'tidyverse', \
'vroom', \
'gert', \
# ---------
'arrow', \
'dbplyr', \
'DBI', \
'dtplyr', \
'RMariaDB', \
'RPostgres', \
'RSQLite', \
'fst', \
# ------------------
# Geospatial
# https://github.com/rocker-org/rocker-versioned2/blob/65309d4d9dac11d3a78dd26ee4bf7b715436db31/scripts/install_geospatial.sh
'RColorBrewer', \
'Randomfields', \
'RNetCDF', \
'classInt', \
'deldir', \
'gstat', \
'hdf5r', \
'lidR', \
'mapdata', \
'maptools', \
'mapview', \
'ncdf4', \
'proj4', \
'raster', \
'rgdal', \
'rgeos', \
'rlas', \
'sf', \
'sp', \
'spacetime', \
'spatstat', \
'spatialreg', \
'spdep', \
'stars', \
'tidync', \
'tmap', \
'geoR', \
'geosphere', \
# ------------------
'arm', \
'deldir', \
'feather', \
'geojsonio', \
'ggmap', \
'GISTools', \
'hexbin', \
'igraph', \
'kableExtra', \
'knitr', \
'lme4', \
'nlme', \
'randomForest', \
'RCurl', \
'rpostgis', \
'shiny', \
'splancs', \
'TraMineR', \
'tufte' \
), repos='https://cran.rstudio.com');" \
## from bioconductor
&& R -e "library(BiocManager); \
BiocManager::install('rhdf5')" \
## Geocomputation in R meta-package
&& R -e "library(devtools); \
devtools::install_github('geocompr/geocompkg');"
# Re-attach conda to path
ENV PATH="/opt/conda/bin:${PATH}"
#--- R/Python ---#
USER root
RUN ln -s /opt/conda/bin/jupyter /usr/local/bin
RUN R -e "install.packages('IRkernel'); \
library(IRkernel); \
IRkernel::installspec(prefix='/opt/conda/');"
ENV LD_LIBRARY_PATH /usr/local/lib/R/lib/:${LD_LIBRARY_PATH}
RUN fix-permissions $HOME \
&& fix-permissions $CONDA_DIR
RUN pip install -U --no-deps rpy2 \
&& rm -rf /home/$NB_USER/.cache/pip \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds
# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID