2
2
# $ docker run -e VMODE="ci" -v $(pwd):/home/plotly --privileged -p 3838:3838 cpsievert/plotly-vtest
3
3
# ------------------------------------------------------------------------------
4
4
5
- FROM ubuntu:16.04
5
+ FROM ubuntu:xenial
6
6
MAINTAINER Carson Sievert "carson@rstudio.com"
7
7
8
8
# Don't print "debconf: unable to initialize frontend: Dialog" messages
9
9
ARG DEBIAN_FRONTED=noninteractive
10
10
ARG CACHEBUST=1
11
11
12
12
# Need this to add R repo
13
- RUN apt-get update && apt-get install -y software-properties-common
14
-
15
- # Add R apt repository
16
- RUN add-apt-repository "deb http://cran.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran35/"
17
- RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x51716619e084dab9
18
-
19
- # Install basic stuff and R
20
- RUN apt-get update && apt-get install -y \
13
+ RUN apt-get update && apt-get install -y software-properties-common apt-transport-https \
14
+ && add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" \
15
+ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 \
16
+ && apt-get update && apt-get install -y \
21
17
sudo \
22
18
git \
23
19
vim-tiny \
@@ -33,11 +29,12 @@ RUN apt-get update && apt-get install -y \
33
29
libcairo2-dev \
34
30
libxt-dev \
35
31
libssl-dev \
36
- libxml2-dev
32
+ libxml2-dev \
33
+ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
34
+ && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
35
+ && locale-gen en_US.utf8 \
36
+ && /usr/sbin/update-locale LANG=en_US.UTF-8
37
37
38
- RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
39
- && locale-gen en_US.utf8 \
40
- && /usr/sbin/update-locale LANG=en_US.UTF-8
41
38
ENV LANG=en_US.UTF-8
42
39
43
40
# Rprofile
@@ -48,30 +45,27 @@ RUN echo 'options(\n\
48
45
shiny.host = "0.0.0.0", shiny.port = 3838\n\
49
46
)' >> /etc/R/Rprofile.site
50
47
51
- # Update R packages
52
- RUN R -e "update.packages(ask = F)"
53
-
54
- # Other R packages needed for running visual tests
55
- RUN R -e "install.packages('devtools')"
56
- RUN R -e "install.packages('roxygen2')"
57
- RUN R -e "install.packages('testthat')"
58
- RUN R -e "install.packages('vdiffr')"
59
- RUN R -e "install.packages('diffobj')"
48
+ # Update R packages and install those needed for visual testing
49
+ RUN R -e "update.packages(ask = F); invisible(lapply(list('devtools', 'roxygen2', 'testthat', 'vdiffr', 'diffobj'), install.packages, dependencies=TRUE, repos='http://cloud.r-project.org/'))"
60
50
61
51
# sf system dependencies
62
- RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes
63
- RUN apt-get -y update
64
- RUN apt-get install -y libudunits2-dev libproj-dev libgeos-dev libgdal-dev
52
+ RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes \
53
+ && apt-get -y update \
54
+ && apt-get install -y libudunits2-dev libproj-dev libgeos-dev libgdal-dev
65
55
66
56
# Install all plotly's dependencies
67
57
RUN R -e "install.packages('plotly', dependencies = T)"
68
58
69
59
# system dependencies related to running orca
70
60
RUN apt-get install -y \
71
- libgtk2.0-0 \
61
+ libgtk2.0-0 \
72
62
libgconf-2-4 \
73
63
xvfb \
74
- fuse \
64
+ xauth \
65
+ libxtst6 \
66
+ libxss1 \
67
+ libnss3 \
68
+ libasound2 \
75
69
desktop-file-utils
76
70
77
71
# google chrome
@@ -81,28 +75,29 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
81
75
apt-get install -y google-chrome-stable
82
76
83
77
# Download orca binary and make it executable under xvfb
84
- RUN wget https://github.com/plotly/orca/releases/download/v1.1.1/orca-1.1.1-x86_64.AppImage -P /home
85
- RUN chmod 777 /home/orca-1.1.1-x86_64.AppImage
86
- RUN printf '#!/bin/bash \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" /home/orca-1.1.1-x86_64.AppImage "$@"' > /usr/bin/orca
87
- RUN chmod 777 /usr/bin/orca
78
+ RUN mkdir -p /opt/orca \
79
+ && cd /opt/orca \
80
+ && wget https://github.com/plotly/orca/releases/download/v1.3.1/orca-1.3.1.AppImage \
81
+ && chmod +x orca-1.3.1.AppImage \
82
+ && ./orca-1.3.1.AppImage --appimage-extract \
83
+ && rm orca-1.3.1.AppImage \
84
+ && printf '#!/bin/bash \nargs=("$@") \nif [[ ! " ${args[@]} " =~ "--no-sandbox" ]]; then \n args+=("--no-sandbox") \nfi \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" /opt/orca/squashfs-root/orca "${args[@]}"' > /usr/bin/orca \
85
+ && chmod +x /usr/bin/orca
88
86
89
87
# switch on visual testing
90
88
ENV VDIFFR=true
91
89
EXPOSE 3838
92
90
93
- RUN R -e "install.packages('assertthat')"
94
- RUN R -e "install.packages('testthat')"
95
- ARG CRANCACHE=1
91
+
96
92
RUN R -e "update.packages(ask=FALSE)"
97
93
RUN R -e "remotes::install_github('r-lib/vdiffr')"
98
- RUN R -e "install.packages('rnaturalearth')"
99
94
100
95
# install any new dependencies, then either manage cases (the default) or run tests
101
96
# note the workaround to get docker to run a proper exit status when there are testthat errors
102
97
# https://github.com/r-lib/testthat/issues/515#issuecomment-304169376
98
+ CMD R -e "remotes::install_deps(dep = TRUE)"
103
99
104
- CMD cd /home/plotly && R -e "devtools::install_deps(dep = T); \
105
- if (!identical(Sys.getenv('VMODE'), 'ci')) vdiffr::manage_cases(); \
100
+ CMD cd /home/plotly; R -e "if (!identical(Sys.getenv('VMODE'), 'ci')) vdiffr::manage_cases(); \
106
101
res <- devtools::test(reporter='summary'); \
107
102
df <- as.data.frame(res); \
108
103
if (sum(df\$failed) > 0 || any(df\$error)) q(status=1)"
0 commit comments