Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (44 loc) · 2.02 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (44 loc) · 2.02 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
# Reproducible environment for regenerating the figures in
# "Optimizing alluvial plots" (paper_figures/).
#
# Build (from the wompwomp repo root):
# docker build -t wompwomp:figures .
#
# Run (RStudio Server on http://localhost:8787, user rstudio):
# docker run --rm -it -p 8787:8787 -e PASSWORD=changeme wompwomp:figures
#
# The scripts in /home/rstudio/wompwomp/paper_figures write their PDFs/PNGs to
# paper_figures/output/. Copy the finished images into the manuscript repo's
# figures_and_tables/ directory.
#
# NeighborNet is implemented natively in R, so there is no Python/conda setup.
FROM rocker/tidyverse:4.5.1
# System libraries: libpng/jpeg/tiff + freetype/harfbuzz/fribidi/fontconfig are
# needed by png, gridtext, systemfonts, ragg, ggfittext and ggrastr; libglpk for
# igraph; the rest for the usual R build toolchain.
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libcurl4-openssl-dev \
libxml2-dev \
libpng-dev \
libjpeg-dev \
libtiff5-dev \
zlib1g-dev \
libfreetype6-dev \
libharfbuzz-dev \
libfribidi-dev \
libfontconfig1-dev \
libglpk-dev \
&& rm -rf /var/lib/apt/lists/*
# CRAN dependencies not already in rocker/tidyverse.
RUN R -q -e "install.packages(c('BiocManager', 'TSP', 'ggalluvial', 'ggforce', 'ggfittext', 'ggrastr', 'data.table', 'igraph', 'mclust', 'sessioninfo'))"
# DuoClustering2018 supplies the clustering-comparison dataset; it is only
# distributed as an R data package, so BiocManager is used to fetch it.
RUN R -q -e "BiocManager::install('DuoClustering2018', update = FALSE, ask = FALSE)"
# Install wompwomp (which now includes plot_alluvial()) from the build context.
COPY . /home/rstudio/wompwomp
RUN R CMD INSTALL --no-build-vignettes /home/rstudio/wompwomp
# Fail the build if plot_alluvial() cannot render.
RUN Rscript /home/rstudio/wompwomp/paper_figures/_smoke_test.R
RUN chown -R rstudio:rstudio /home/rstudio/wompwomp
WORKDIR /home/rstudio/wompwomp/paper_figures