-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathDockerfile.jammy
126 lines (108 loc) · 4.26 KB
/
Dockerfile.jammy
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
FROM ubuntu:jammy
# Configure apt-get to use the mirror in us-east-1 instead of the Docker default of archive.ubuntu.com
RUN sed -i "s/archive.ubuntu.com/us-east-1.ec2.archive.ubuntu.com/g" /etc/apt/sources.list
# update apt & install packages
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
cmake \
curl \
git \
gnupg \
libboost-all-dev \
libcurl4-openssl-dev \
locales \
lsb-release \
openssh-client \
protobuf-compiler \
sudo && \
rm -rf /var/lib/apt/lists/*
# add R apt repository
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x51716619e084dab9 && \
echo "deb http://cran.rstudio.com/bin/linux/ubuntu jammy-cran40/" >> /etc/apt/sources.list.d/cran-rstudio.list
# Ensure FreeTDS is added to unixodbc upon installation
RUN echo tdsodbc freetds/addtoodbc boolean true | debconf-set-selections
# Install libraries & database related packages separately to break up the layers
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
gdebi-core \
jags \
libaio1 \
libatlas3-base \
libcairo2 \
libcairo2-dev \
libev-dev \
libfftw3-dev \
libgdal-dev \
libgraphviz-dev \
libgsl0-dev \
libmagick++-dev \
libmysqlclient21 \
libmysqlclient-dev \
libnetcdf-dev \
libpcre2-dev \
libprocps-dev \
libproj-dev \
libprotoc-dev \
libquantlib0-dev \
libsasl2-dev \
libssh-dev \
libsqliteodbc \
libxml2-dev \
libxt-dev \
libxt6 \
odbc-postgresql \
tdsodbc \
unixodbc \
unixodbc-dev \
wget \
zip && \
rm -f /etc/ImageMagick-6/policy.xml && \
rm -rf /var/lib/apt/lists/*
# Install the RStudio Professional Drivers (includes mysql drivers)
RUN wget -q https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers_2023.05.0_amd64.deb && \
gdebi -n rstudio-drivers_2023.05.0_amd64.deb && \
cat /opt/rstudio-drivers/odbcinst.ini.sample >> /etc/odbcinst.ini && \
rm rstudio-drivers_2023.05.0_amd64.deb
# Install JDK and Cargo separately to avoid the recommended packages
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openjdk-11-jdk cargo && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-dev \
python3-pip \
python3-venv \
python3-virtualenv && \
rm -rf /var/lib/apt/lists/*
# Install Julia
RUN wget -q https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.1-linux-x86_64.tar.gz && \
tar -C /usr/local -zxf julia-1.9.1-linux-x86_64.tar.gz && \
ln -s /usr/local/julia-1.9.1/bin/julia /usr/local/bin/julia && \
rm julia-1.9.1-linux-x86_64.tar.gz
# Install of texlive. Use --no-install-recommends to avoid installing ~750MB of documentation
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
texlive-full && \
rm -rf /var/lib/apt/lists/*
# add in the less secure openssl config file
# End-user applications can optionally reference this file to allow connection to less secure systems.
# https://community.rstudio.com/t/rmysql-to-mysql-database-on-aws-ssl-connection-error-after-deploying/100676
COPY insecure-openssl.cnf /etc/ssl/insecure-openssl.cnf
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive TZ='Etc/UTC' apt-get install tzdata && \
apt-get install -s r-base-core r-base-dev | sed -e "/The following additional packages will be installed/,/^\w/!d;//d" -e "s/\br-.*\b//g" | xargs apt-get install -y
# set default locale
RUN update-locale --reset LANG=C.UTF-8
# set a non-default global location for Renviron.site.
# This would typically be found at $R_HOME/etc/Renviron.site, but we'd like it not to be a layer in the per-R version images.
# https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html
ENV R_ENVIRON /etc/R/Renviron.site
COPY Renviron.site /etc/R/Renviron.site
ARG R_VERSION=4.3.1
ENV PATH /opt/R/${R_VERSION}/bin:$PATH
# Install R
RUN wget -q https://cdn.rstudio.com/r/ubuntu-2204/R-${R_VERSION}-ubuntu-2204.tar.gz -O /tmp/R-${R_VERSION}.tar.gz && \
mkdir -p /opt/R && \
tar zx -C /opt/R -f /tmp/R-${R_VERSION}.tar.gz && \
rm /tmp/R-${R_VERSION}.tar.gz