forked from hklement/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (26 loc) · 1.72 KB
/
Copy pathDockerfile
File metadata and controls
31 lines (26 loc) · 1.72 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
FROM openhpi/docker_exec_phusion
LABEL org.opencontainers.image.vendor='openHPI Team'
LABEL org.opencontainers.image.authors='openhpi-info@hpi.de'
LABEL org.opencontainers.image.title='R 4.0 execution environment for CodeOcean'
LABEL org.opencontainers.image.description='This image provides a R 4.0 environment with custom libraries from Berry.'
LABEL org.opencontainers.image.url='https://github.com/openHPI/dockerfiles'
LABEL run_command='Rscript -e "options(warn=1); source('%{filename}', echo=TRUE)"'
LABEL test_command='Rscript %{filename}'
# Get target architecture from Docker buildx
ARG TARGETARCH
# Install latest R version 4.0
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
add-apt-repository -y "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" --no-update
RUN install_clean r-base build-essential libcurl4-openssl-dev libssl-dev libuv1-dev libpoppler-cpp-dev poppler-data libjpeg-dev libz-dev
# Add custom CRAN packages
RUN Rscript -e 'pkgs <- c("zoo", "testthat", "checkmate", "pdftools", "base64enc", "remotes"); \
install.packages(pkgs, repos = "https://cloud.r-project.org"); \
missing <- pkgs[!vapply(pkgs, requireNamespace, logical(1), quietly = TRUE)]; \
if (length(missing)) stop("Failed to install: ", paste(missing, collapse = ", "))'
# Add custom github packages
RUN Rscript -e 'remotes::install_github(c("brry/berryFunctions", "openHPI/codeoceanR")); \
pkgs <- c("berryFunctions", "codeoceanR"); \
missing <- pkgs[!vapply(pkgs, requireNamespace, logical(1), quietly = TRUE)]; \
if (length(missing)) stop("Failed to install: ", paste(missing, collapse = ", "))'
# Adjust Path variables
ENV PAGER=/usr/bin/cat