-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
49 lines (44 loc) · 1.27 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
# cross python and R environments
# to use:
# docker build -t thistly-cross .
# docker run --rm -ti -v $(pwd):/home/felixity thistly-cross \
# python3 marginalizable_state_space_model.py
# to troubleshoot:
# docker run -it --entrypoint /bin/bash thistly-cross
FROM ubuntu:22.04
COPY renv.lock requirements-docker.txt ./
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \
apt-get install -y python3.10-dev \
python3-pip \
r-base-dev \
g++ \
fontconfig \
make \
cmake \
git \
libnlopt-dev \
libcurl4-openssl-dev \
libssl-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libxml2-dev \
msttcorefonts \
font-manager \
cm-super \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir -r requirements-docker.txt \
&& R -e "install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org'))" \
&& R -e "remotes::install_github('rstudio/renv')" \
&& R -e "renv::restore()" \
&& useradd felixity
# switch to non-root user
USER felixity
WORKDIR /home/felixity
RUN echo ".libPaths('/usr/local/lib/R/site-library')" >> .Rprofile
ENV PYTHONPATH "${PYTHONPATH}:/home/felixity"