-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_package_builder
56 lines (45 loc) · 1.32 KB
/
Dockerfile_package_builder
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
#latest tested version 4.4.1
FROM rocker/r-ver:latest
ENV PPM_URL=packagemanager.posit.co/cran/__linux__/jammy/latest
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
git \
gdebi-core \
imagemagick \
libfribidi-dev \
libgit2-dev \
libharfbuzz-dev \
libmagick++-dev \
libssl-dev \
libtiff-dev \
libxml2-dev \
#for PostgreSQL
odbc-postgresql \
unixodbc-dev \
sqlite3 \
libsqliteodbc
COPY /phenoRankeR ./phenoRankeR
WORKDIR /phenoRankeR
RUN Rscript -e "renv:::renv_pak_init(force = TRUE)"
ENV RENV_CONFIG_PAK_ENABLED=TRUE
RUN Rscript -e "options(repos = c(PPM = 'https://${PPM_URL}')); renv::restore()"
# build package
ENV RENV_CONFIG_PAK_ENABLED=FALSE
WORKDIR /opt
RUN mkdir odbc
RUN { \
echo "[SQLite]"; \
echo "Driver = /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so"; \
} >> /opt/odbc/odbcinst.ini
RUN echo "CREATE TABLE test (id INTEGER PRIMARY KEY);" | sqlite3 /opt/test.db
WORKDIR /phenoRankeR
ENV ODBCSYSINI=/opt/odbc
ENV DB_DRIVER=SQLite
ENV DB_NAME=/opt/test.db
RUN mkdir /opt/build
ARG IGNORE_CACHE_FROM_HERE=unknown
RUN echo "IGNORE_CACHE_FROM_HERE=${IGNORE_CACHE_FROM_HERE}"
RUN Rscript -e "devtools::test()" > /opt/build/test.log
RUN Rscript dev/03_deploy.R > /opt/build/build.log
WORKDIR /
RUN cp *.tar.gz /opt/build/.
CMD ["sh"]