-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathDockerfile.ubuntu2204
124 lines (104 loc) · 3.83 KB
/
Dockerfile.ubuntu2204
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
# Using dated tags from https://hub.docker.com/_/ubuntu/
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
ARG DISTRIBUTION=ubuntu-2204
ARG R_VERSION=3.6.3
ARG R_INSTALLER=r-${R_VERSION}_1_amd64.deb
ARG PYTHON_VERSION=3.9.5
# 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
ENV TZ=UTC
# 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 \
libarchive-dev \
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.
RUN curl -fsSL -O https://cdn.rstudio.com/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.
RUN curl -fsSL -O https://cdn.rstudio.com/python/${DISTRIBUTION}/pkgs/python-${PYTHON_VERSION}_1_amd64.deb \
&& apt-get install -yq --no-install-recommends ./python-${PYTHON_VERSION}_1_amd64.deb \
&& rm -rf python-${PYTHON_VERSION}_1_amd64.deb \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade setuptools
# install quarto
ARG QUARTO_VERSION=1.3.340
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__/jammy/latest")' \
&& /tmp/maybe_install_quarto.sh \
&& rm -f /tmp/maybe_install_quarto.sh