-
Notifications
You must be signed in to change notification settings - Fork 18
/
.gitpod.Dockerfile
52 lines (43 loc) · 2.13 KB
/
.gitpod.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
FROM gitpod/workspace-full
LABEL org.label-schema.license="GPL-3.0" \
org.label-schema.vcs-url="https://github.com/matrix-profile-foundation/tsmp" \
org.label-schema.vendor="Matrix Profile Foundation" \
maintainer="Francisco Bischoff <fbischoff@med.up.pt>" \
description="Docker for testing TSMP"
## Begin Root tasks ##
USER root
### base ###
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN echo "deb https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/" >> /etc/apt/sources.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN apt-get update
RUN apt-get install -yq \
r-base \
&& locale-gen en_US.UTF-8 \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
COPY --chown=gitpod:gitpod * /workspace/tsmp/
## End Root tasks ##
## Begin User tasks ##
USER gitpod
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV HOME=/home/gitpod
RUN Rscript -e 'if(!dir.exists(Sys.getenv("R_LIBS_USER"))) dir.create(Sys.getenv("R_LIBS_USER"), recursive=TRUE)'
RUN Rscript -e 'if (!require("devtools")) install.packages("devtools", lib = Sys.getenv("R_LIBS_USER"))'
RUN Rscript -e 'if (!require("RJSONIO")) install.packages("RJSONIO", lib = Sys.getenv("R_LIBS_USER"))'
RUN Rscript -e 'if (!require("languageserver")) install.packages("languageserver", lib = Sys.getenv("R_LIBS_USER"))'
RUN Rscript -e 'devtools::install_github("jimhester/covr", ref = "master")'
RUN Rscript -e 'setwd("/workspace/tsmp"); devtools::install_deps(dep = TRUE)'
### checks ###
# no root-owned files in the home directory
RUN notOwnedFile=$(find . -not "(" -user gitpod -and -group gitpod ")" -print -quit) \
&& { [ -z "$notOwnedFile" ] \
|| { echo "Error: not all files/dirs in $HOME are owned by 'gitpod' user & group"; exit 1; } }
# RUN Rscript -e 'setwd("/workspace/tsmp"); devtools::check(args = c("--as-cran"), env_vars = NULL)'
RUN echo "/usr/bin/R" >> ~/.bashrc
RUN echo ".First <- function() devtools::load_all()" > ~/.Rprofile
## End user tasks ##
## Give back control to the engine ##
USER root
# https://gitpod.io/#https://github.com/matrix-profile-foundation/tsmp/tree/franzbischoff/gitpod-setup