Skip to content

Commit

Permalink
set TMPDIR try to solve rstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
fang19911030 committed Oct 16, 2023
1 parent 704c986 commit d36f3a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ RUN apt-get update && \
WORKDIR /home/app
USER app
ENV HOME /home/app
ENV TMPDIR /home/app/.tmp

####
# POSTGIS
Expand Down Expand Up @@ -121,13 +122,14 @@ RUN sudo service postgresql start \
#####

RUN sudo Rscript -e "install.packages('renv',repos='https://cloud.r-project.org/')" \
&& cd /home/app
&& cd /home/app \
&& mkdir $TMPDIR
# && Rscript -e "renv::restore()"
# && Rscript -e "cmdstanr::install_cmdstan()"
COPY --chown=app:app renv.cache $HOME/.cache
COPY --chown=app:app renv.lock $HOME/renv.lock
COPY --chown=app:app renv $HOME/renv
RUN sudo Rscript -e "renv::restore()"
RUN sudo Rscript -e 'Sys.setenv(TMPDIR = Sys.getenv("TMPDIR"));renv::restore()'
COPY --chown=app:app Docker.Rprofile $HOME/.Rprofile

RUN git clone https://www.github.com/stan-dev/cmdstan --recurse-submodules \
Expand All @@ -139,5 +141,5 @@ RUN git clone https://www.github.com/stan-dev/cmdstan --recurse-submodules \
# && cd cmdstan \
# && make build
# RUN /bin/bash -c "/usr/bin/echo 'sudo service postgresql start' >> /home/app/.bashrc"

RUN rm -rf $TMPDIR
CMD ["/bin/bash"]

0 comments on commit d36f3a7

Please sign in to comment.