-
Notifications
You must be signed in to change notification settings - Fork 56
/
Dockerfile.ubuntu1804
130 lines (109 loc) · 4.12 KB
/
Dockerfile.ubuntu1804
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
# Using dated tags from https://hub.docker.com/_/ubuntu/
FROM ubuntu:18.04
# Locale configuration --------------------------------------------------------#
RUN apt-get update \
&& apt-get install -y --no-install-recommends locales \
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& rm -rf /var/lib/apt/lists/*
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ARG DEBIAN_FRONTEND=noninteractive
# Installation prerequisites --------------------------------------------------#
# curl is used to download things.
# libev-dev is required for most interactive Python applications.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
libev-dev \
&& rm -rf /var/lib/apt/lists/*
# System dependencies needed by popular R packages
# https://docs.rstudio.com/rsc/post-setup-tool/#install-system-dependencies
# Now, install the system requirements for R packages.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
default-jdk \
gdal-bin \
git \
gsfonts \
imagemagick \
libcairo2-dev \
libcurl4-openssl-dev \
libfontconfig1-dev \
libfreetype6-dev \
libfribidi-dev \
libgdal-dev \
libgeos-dev \
libgl1-mesa-dev \
libglpk-dev \
libglu1-mesa-dev \
libgmp3-dev \
libharfbuzz-dev \
libicu-dev \
libjpeg-dev \
libmagick++-dev \
libmysqlclient-dev \
libpng-dev \
libpq-dev \
libproj-dev \
libsodium-dev \
libssh2-1-dev \
libssl-dev \
libtiff-dev \
libudunits2-dev \
libv8-dev \
libicu-dev \
libxml2-dev \
make \
perl \
tcl \
tk \
tk-dev \
tk-table \
unixodbc-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Install TinyTeX --------------------------------------------------------------#
# From https://github.com/rstudio/r-docker/blob/master/base/bionic/Dockerfile
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update \
&& apt-get install -y --no-install-recommends wget \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL "https://yihui.org/tinytex/install-bin-unix.sh" | sh \
&& /root/.TinyTeX/bin/*/tlmgr path remove \
&& mv /root/.TinyTeX/ /opt/TinyTeX \
&& /opt/TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin \
&& /opt/TinyTeX/bin/*/tlmgr path add \
&& rm -rf /var/lib/apt/lists/*
# Install R -------------------------------------------------------------------#
# Reference: https://docs.rstudio.com/resources/install-r/
# We are NOT linking one of these R versions into the PATH.
ARG R_DISTRIBUTION=ubuntu-1804
ARG R_VERSION=3.6.3
ARG R_INSTALLER=r-${R_VERSION}_1_amd64.deb
RUN curl -fsSL -O https://cdn.rstudio.com/r/${R_DISTRIBUTION}/pkgs/${R_INSTALLER} \
&& apt-get update \
&& apt-get install -f -y --no-install-recommends ./${R_INSTALLER} \
&& rm ${R_INSTALLER} \
&& rm -rf /var/lib/apt/lists/*
# Install Python --------------------------------------------------------------#
# Reference: https://docs.rstudio.com/resources/install-python/
# We are NOT linking one of these Python versions into the PATH.
ARG MINICONDA_VERSION=4.7.12.1
ARG PYTHON_VERSION=3.7.6
# The documented approach uses a particular miniconda install script version
# to obtain the desired Python version. We are first installing miniconda and
# then asking it to install different Python versions.
RUN curl -fsSL -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-${MINICONDA_VERSION}-Linux-x86_64.sh \
&& chmod 755 miniconda.sh \
&& ./miniconda.sh -b -p /opt/miniconda \
&& /opt/miniconda/bin/conda create --quiet --yes --prefix /opt/python/${PYTHON_VERSION} python=${PYTHON_VERSION} virtualenv \
&& rm -f miniconda.sh \
# remove miniconda too, for size
&& rm -rf /opt/miniconda
# install quarto
ARG QUARTO_VERSION=1.0.37
COPY maybe_install_quarto.sh /tmp/maybe_install_quarto.sh
RUN /opt/R/${R_VERSION}/bin/R -e 'install.packages("odbc", repos="https://packagemanager.posit.co/cran/__linux__/bionic/latest")' \
&& /tmp/maybe_install_quarto.sh \
&& rm -f /tmp/maybe_install_quarto.sh