forked from timoklimmer/mro-on-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (47 loc) · 2.33 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
# use Ubuntu 18.04 as base image
FROM ubuntu:18.04
# give our new image a name
LABEL Name=mro-on-docker Version=0.0.1
# set the bash shell as default
# note: this is required. if not set, we cannot "run interactive" the image
CMD /bin/bash
# let Ubuntu know that we cannot use an interactive frontend during Docker image build
ARG DEBIAN_FRONTEND=noninteractive
# update Ubuntu's package information
RUN apt-get update -y
# install some basic packages needed later
RUN apt-get install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev unzip curl apt-transport-https unixodbc unixodbc-dev -y
# install Microsoft R Open (with MKL)
# notes: - see https://mran.microsoft.com/download for newest versions
RUN apt-get install wget -y \
&& wget https://mran.blob.core.windows.net/install/mro/3.5.3/ubuntu/microsoft-r-open-3.5.3.tar.gz \
&& tar -xf microsoft-r-open-3.5.3.tar.gz \
&& ./microsoft-r-open/install.sh -a -u \
&& rm microsoft-r-open-3.5.3.tar.gz
# install ODBC driver for SQL Server
# note: don't forget to update the URL below for the right OS version in case the OS version is changed
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update -y \
&& ACCEPT_EULA=Y apt-get install msodbcsql17 -y
# install additional packages
# notes: - see Dockerfile reference for copying files/directories into the image in case you want
# to add your own packages which are not on CRAN
# - re-install of curl/httr to fix a bug with devtools's package installation feature
# devtools
RUN Rscript -e "install.packages('devtools')" \
&& Rscript -e "remove.packages(c('curl', 'httr'))" \
&& Rscript -e "install.packages(c('curl', 'httr'))"
ENV CURL_CA_BUNDLE="/utils/microsoft-r-open-3.4.3/lib64/R/lib/microsoft-r-cacert.pem"
# jsonlite
RUN Rscript -e "install.packages('jsonlite')"
# data.table
RUN Rscript -e "install.packages('data.table')"
# RODBC (not installed by default in MRO's Linux version)
RUN Rscript -e "install.packages('RODBC')"
# shiny
RUN Rscript -e "install.packages('shiny')"
COPY ./shiny-app /shiny-app
COPY ./shiny-computer-vision-api-sample /shiny-computer-vision-api-sample
EXPOSE 80/tcp
ENTRYPOINT Rscript -e "shiny::runApp(appDir='/shiny-app', host='0.0.0.0', port=80)"