Dockerising一个闪亮的应用程序

时间:2018-02-22 20:45:34

标签: docker shiny shiny-server

我正在尝试为闪亮的应用程序创建一个docker容器。为此,我有以下docker文件:

    # Start from an image containing R
FROM r-base:latest

# Install dependencies
RUN apt-get update && apt-get install -y \
    sudo \
    gdebi-core \
    pandoc \
    pandoc-citeproc \
    libcurl4-gnutls-dev \
    libcairo2-dev/unstable \
    libxt-dev \
    libssl-dev \
    gsl-bin \
    libgsl0-dev \
    default-jdk


RUN wget --no-verbose https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/VERSION -O "version.txt" && \
    VERSION=$(cat version.txt)  && \
    wget --no-verbose "https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \
    gdebi -n ss-latest.deb && \
    rm -f version.txt ss-latest.deb


# I needed this for rJava-related errors
RUN R CMD javareconf

# Install R packages required by my app
RUN R -e "install.packages(c('shiny', 'xlsx', 'tidyr', 'DT', 'RColorBrewer', 'ggdendro', 'dendsort', 'grid', 'gridExtra', 'igraph', 'circlize', 'gplots', 'shinyFiles', 'shinydashboard', 'shinyjs', 'devtools', 'fpc', 'cluster', 'readr', 'CytobankAPI', 'stringr', 'dplyr', 'tibble'), repos='http://cran.rstudio.com/')"

# Install Bioconductor dependencies
RUN Rscript -e 'source("http://bioconductor.org/biocLite.R")' -e 'biocLite("ComplexHeatmap")' 

# Remove Shiny example inherited from the base image
RUN rm -rf /srv/shiny-server/*

# copy the app to the image
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
RUN mkdir /srv/shiny-server/cytocluster/
COPY ./* /srv/shiny-server/cytocluster/
EXPOSE 3838
COPY shiny-server.sh /usr/bin/shiny-server.sh
RUN chmod +x /usr/bin/shiny-server.sh

CMD ["/usr/bin/shiny-server.sh"]

创建的图像没有任何错误,但是当我运行时:

docker run --rm -p 3838:3838 [image]

它只是在没有应用程序启动的情况下运行。有任何建议/提示吗?

非常感谢提前。

0 个答案:

没有答案