-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (48 loc) · 2.26 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
# This Dockerfile is based on the rocker/binder example Dockerfile from https://github.com/rocker-org/binder/
FROM rocker/binder:4.1
## Declares build arguments
ARG NB_USER
ARG NB_UID
# Install system dependency for pdftools
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpoppler-cpp-dev \
pdfgrep \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
## Run install.R script
COPY install.R ${HOME}
RUN R --quiet -f install.R
## Copies all repo files into the Docker Container
USER root
COPY . ${HOME}
RUN chown -R ${NB_USER} ${HOME}
## Become normal user again
USER ${NB_USER}
## Export system libraries and R package versions
RUN dpkg --list > dpkg-list.txt && \
R -e 'capture.output(knitr::kable(as.data.frame(installed.packages())[c("Package", "Version", "License", "Built")], format = "markdown", row.names = FALSE), file = "r-packages.md")'
# --- Metadata ---
LABEL maintainer="[email protected]" \
Name="AGILE reproducibility reviews 2023" \
org.opencontainers.image.created="2022-04" \
org.opencontainers.image.authors="Daniel Nüst" \
org.opencontainers.image.url="https://github.com/reproducible-agile/reviews-2023" \
org.opencontainers.image.documentation="https://github.com/reproducible-agile/reviews-2023" \
org.label-schema.description="AGILE reproducibility reviews workflow image (license: Apache 2.0)"
# --- Development instructions ---
# From time to time, run a linter on the Dockerfile:
# $ docker run -it --rm --privileged -v $PWD:/root/ projectatomic/dockerfile-lint dockerfile_lint
# --- Usage instructions ---
## Build the image
# $ docker build --tag repro-review .
#
## Run the image for interactive UI
# $ docker run -it -p 8888:8888 repro-review
# Next, open a browser at http://localhost:8888 or click on the login link shown in the console.
# It will show the Jupyter start page and you can now open RStudio via the menu "New".
#
## Run the image to render the PDF for the assessment figures or the text analysis
# $ docker run -i -v $(pwd):/review --user $UID repro-review Rscript -e 'setwd("/review"); rmarkdown::render("agile-reproducibility-reviews.Rmd")'
# $ docker run -i -v $(pwd):/review --user $UID repro-review Rscript -e 'setwd("/review"); rmarkdown::render("agile-reproducibility-reviews.Rmd")'