-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
96 lines (82 loc) · 4.3 KB
/
Copy pathDockerfile
File metadata and controls
96 lines (82 loc) · 4.3 KB
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
FROM ubuntu:24.04
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="INBOmd" \
org.label-schema.description="A docker image with examples files for INBOmd." \
org.label-schema.license="GPL-3.0" \
org.label-schema.url="e.g. https://www.inbo.be/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/inbo/INBOmd" \
org.label-schema.vendor="Research Institute for Nature and Forest (INBO)" \
maintainer="Thierry Onkelinx <thierry.onkelinx@inbo.be>"
## for apt to be noninteractive
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
WORKDIR /github/workspace
## Set a default user. Available via runtime flag `--user docker`
## Add user to 'staff' group, granting them write privileges to /usr/local/lib/R/site.library
## User should also have & own a home directory (for rstudio or linked volumes to work properly).
RUN useradd docker \
&& mkdir /home/docker \
&& chown docker:docker /home/docker
## Configure default locale, see https://github.com/rocker-org/rocker/issues/19
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
dirmngr \
git \
ghostscript \
gnupg \
imagemagick \
libcurl4-openssl-dev \
libpoppler-cpp-dev \
libpq-dev \
locales \
software-properties-common \
wget \
&& apt-get clean \
&& echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen nl_BE.utf8 \
&& /usr/sbin/update-locale LANG=nl_BE.UTF-8
ENV LC_ALL=nl_BE.UTF-8
ENV LANG=nl_BE.UTF-8
## R repo
RUN wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc \
&& add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
r-base-dev \
&& apt-get clean \
&& wget https://github.com/jgm/pandoc/releases/download/3.1.8/pandoc-3.1.8-1-amd64.deb \
&& dpkg -i pandoc-3.1.8-1-amd64.deb \
&& rm pandoc-3.1.8-1-amd64.deb
COPY docker/.Rprofile /usr/lib/R/etc/Rprofile.site
## install pak
RUN Rscript --no-save --no-restore -e 'install.packages("pak")' \
&& Rscript --no-save --no-restore -e 'pak::pkg_install(c("bookdown", "checklist", "dplyr", "DT", "here", "INBOtheme", "kableExtra", "lipsum", "pander", "pdftools", "qrcode", "webshot"), dependencies = TRUE)' \
&& Rscript -e 'webshot::install_phantomjs()' \
&& Rscript -e 'tinytex::install_tinytex()' \
&& Rscript -e 'tinytex::tlmgr_install(c("babel-dutch", "babel-english", "babel-french", "beamer", "beamerswitch", "booktabs", "carlisle", "colortbl", "datetime", "draftwatermark", "dvips", "emptypage", "environ", "epstopdf", "eso-pic", "eurosym", "extsizes", "fancyhdr", "fancyvrb", "fmtcount", "float", "fontspec", "footmisc", "framed", "helvetic", "hyphen-dutch", "hyphen-french", "inconsolata", "lastpage", "lipsum", "makecell", "marginnote", "mdframed", "multirow", "parskip", "pdflscape", "pdfpages", "pdftexcmds", "placeins", "needspace", "tabu", "tex", "textpos", "threeparttable", "threeparttablex", "titlesec", "times", "tocloft", "translator", "trimspaces", "ulem", "upquote", "wrapfig", "xcolor", "xstring", "zref"))' \
&& mkdir ${HOME}/.fonts \
&& wget https://www.wfonts.com/download/data/2014/12/12/calibri/calibri.zip \
&& unzip calibri.zip -d ${HOME}/.fonts \
&& rm calibri.zip \
&& wget -O ${HOME}/.fonts/Inconsolatazi4-Regular.otf http://mirrors.ctan.org/fonts/inconsolata/opentype/Inconsolatazi4-Regular.otf \
&& wget -O ${HOME}/.fonts/Inconsolatazi4-Bold.otf http://mirrors.ctan.org/fonts/inconsolata/opentype/Inconsolatazi4-Bold.otf \
&& fc-cache -fv \
&& Rscript -e 'tinytex:::updmap()'
## Install current version of INBOmd
COPY .Rbuildignore inbomd/.Rbuildignore
COPY DESCRIPTION inbomd/DESCRIPTION
COPY inst inbomd/inst
COPY man inbomd/man
COPY NAMESPACE inbomd/NAMESPACE
COPY NEWS.md inbomd/NEWS.md
COPY R inbomd/R
COPY README.md inbomd/README.md
COPY vignettes inbomd/vignettes
RUN Rscript --no-save --no-restore -e 'remotes::install_local("inbomd")' \
&& Rscript --no-save --no-restore -e 'tinytex::tlmgr_conf(c("auxtrees", "add", system.file("local_tex", package = "INBOmd")))'
COPY docker/entrypoint.sh /entrypoint.sh
ENV PATH=$PATH:/root/bin:/github/home/bin
ENTRYPOINT ["/entrypoint.sh"]