-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
124 lines (98 loc) · 3.99 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
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
# To build, cd to this directory, then:
# docker build -t ss-shiny-devel .
#
# To run with the built-in shiny-examples:
# docker run --rm -p 3838:3838 --name ss ss-shiny-devel
FROM ubuntu:16.04
MAINTAINER Viktorian Miok, Seven Bridges, <[email protected]>
# =====================================================================
# R
# =====================================================================
# Don't print "debconf: unable to initialize frontend: Dialog" messages
ARG DEBIAN_FRONTED=noninteractive
# Need this to add R repo
RUN apt-get update && apt-get install -y software-properties-common
# Add R apt repository
RUN add-apt-repository "deb http://cran.r-project.org/bin/linux/ubuntu $(lsb_release -cs)/"
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
# Install basic stuff and R
RUN apt-get update && apt-get install -y \
sudo \
git \
vim-tiny \
less \
wget \
r-base \
r-base-dev \
r-recommended \
fonts-texgyre \
texinfo \
locales
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.utf8 \
&& /usr/sbin/update-locale LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN echo 'options(\n\
repos = c(CRAN = "https://cloud.r-project.org/"),\n\
download.file.method = "libcurl",\n\
# Detect number of physical cores\n\
Ncpus = parallel::detectCores(logical=FALSE)\n\
)' >> /etc/R/Rprofile.site
# Install TinyTeX (subset of TeXLive)
# From FAQ 5 and 6 here: https://yihui.name/tinytex/faq/
# Also install ae, parskip, and listings packages to build R vignettes
RUN wget -qO- \
"https://github.com/yihui/tinytex/raw/master/tools/install-unx.sh" | \
sh -s - --admin --no-path \
&& ~/.TinyTeX/bin/*/tlmgr path add \
&& tlmgr install metafont mfware inconsolata tex ae parskip listings \
&& tlmgr path add \
&& Rscript -e "source('https://install-github.me/yihui/tinytex'); tinytex::r_texmf()"
# This is necessary for non-root users to follow symlinks to /root/.TinyTeX
RUN chmod 755 /root
# Create docker user with empty password (will have uid and gid 1000)
RUN useradd --create-home --shell /bin/bash docker \
&& passwd docker -d \
&& adduser docker sudo
RUN apt-get install -y \
gdebi-core \
pandoc \
pandoc-citeproc \
libcurl4-gnutls-dev \
libcairo2-dev \
libxt-dev \
libssl-dev
# Download and install shiny server
RUN wget --no-verbose https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-14.04/x86_64/VERSION -O "version.txt" && \
VERSION=$(cat version.txt) && \
wget --no-verbose "https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-14.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \
gdebi -n ss-latest.deb && \
rm -f version.txt ss-latest.deb && \
R -e "install.packages(c('shiny', 'rmarkdown'))" && \
cp -R /usr/local/lib/R/site-library/shiny/examples/* /srv/shiny-server/
EXPOSE 3838
COPY shiny-server.sh /usr/bin/shiny-server.sh
CMD ["/usr/bin/shiny-server.sh"]
RUN apt-get update && apt-get install -y \
libxml2-dev
RUN R -e "install.packages(c('devtools', 'packrat'))"
# For deploying apps from a container
RUN R -e "devtools::install_github('rstudio/rsconnect')"
# Install shiny-examples, and fix permissions for apps that require write
# access.
RUN cd /srv && \
mv shiny-server shiny-server-orig && \
wget -nv https://github.com/rstudio/shiny-examples/archive/master.zip && \
unzip -x master.zip && \
mv shiny-examples-master shiny-server && \
rm master.zip && \
cd shiny-server && \
chmod 777 022-unicode-chinese 055-observer-demo 059-reactive-poll-and-file-reader
# Autodetect packages needed for the examples (will install from CRAN)
RUN R -e "install.packages(packrat:::dirDependencies('/srv/shiny-server'))"
# Packages that need to be installed from GitHub
# For 087-crandash
RUN R -e "devtools::install_github('hadley/shinySignals')"
RUN R -e "devtools::install_github('jcheng5/bubbles')"
# Install latest shiny from GitHub
RUN R -e "devtools::install_github('rstudio/shiny')"