-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
56 lines (45 loc) · 2.29 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
FROM rocker/tidyverse:4.4.0
RUN apt-get update && \
apt-get install -y build-essential clang imagemagick libmagick++-dev libudunits2-dev curl libgdal-dev \
libjpeg-dev libxt-dev libprotobuf-dev protobuf-compiler libjq-dev libzmq3-dev \
libv8-dev libnode-dev
# Install Rust and Cargo. Some R packages requires Rust.
# See: b/113106905
# Script is pulled from https://sh.rustup.rs and mirrored locally for security reasons.
# See: b/238367731
ADD rustup.sh rustup.sh
RUN cat rustup.sh | sh -s -- -y
ADD clean-layer.sh /tmp/clean-layer.sh
RUN apt-get update && \
apt-get install apt-transport-https && \
apt-get install -y -f libv8-dev libgeos-dev libgdal-dev libproj-dev libsndfile1-dev \
libtiff5-dev fftw3 fftw3-dev libfftw3-dev libjpeg-dev libhdf4-0-alt libhdf4-alt-dev \
libhdf5-dev libx11-dev cmake libglu1-mesa-dev libgtk2.0-dev librsvg2-dev libxt-dev \
patch libgit2-dev && \
/tmp/clean-layer.sh
# For package `imager`
RUN apt-get install -y libfftw3-dev libtiff-dev libxml2-dev libicu-dev libgmp-dev libpng-dev libglpk-dev && \
/tmp/clean-layer.sh
# TODO(b/324184434): necessary for mxnet, let's try to remove in the future.
RUN R -e "install.packages('DiagrammeR')"
RUN apt-get update && apt-get install -y build-essential git ninja-build ccache libatlas-base-dev libopenblas-dev libopencv-dev python3-opencv && \
cd /usr/local/share && git clone --recursive --depth=1 --branch v1.9.x https://github.com/apache/incubator-mxnet.git mxnet && \
cd mxnet && cp config/linux.cmake config.cmake && rm -rf build && \
mkdir -p build && cd build && cmake .. && cmake --build . --parallel $(nproc) && \
cd .. && make -f R-package/Makefile rpkg && \
/tmp/clean-layer.sh
# Needed for "h5" library
RUN apt-get install -y libhdf5-dev && \
# Needed for "topicmodels" library
apt-get install -y libgsl-dev && \
# Needed for "tesseract" library
apt-get install -y libpoppler-cpp-dev libtesseract-dev tesseract-ocr-eng && \
/tmp/clean-layer.sh
ADD packages packages
ADD packages_users packages_users
ADD package_installs.R /tmp/package_installs.R
ADD utils.R /tmp/utils.R
RUN Rscript /tmp/package_installs.R && \
bash -c "rm -Rf /tmp/Rtmp*"
# Used in the `rstats` Jenkins `Docker GPU Build` step to restrict the images being pruned.
LABEL kaggle-lang=r