我从 docker image 构建了奇异容器kfoltynski/shinyproxy-demo:singularity
。当我跑
singularity run shiny.simg 3839
闪亮的应用程序可用localhost:3839
,但在运行奇异容器作为实例之后
singularity instance start shiny.simg shiny 3839
它不是。为什么?
重现步骤:
FROM openanalytics/r-base
MAINTAINER Tobias Verbeke "Tazovsky"
RUN apt-get update && apt-get install -y \
sudo \
pandoc \
pandoc-citeproc \
libcurl4-gnutls-dev \
libcairo2-dev \
libxt-dev \
libssl-dev \
libssh2-1-dev \
libssl1.0.0
# packages needed for basic shiny functionality
RUN R -e "install.packages(c('shiny', 'rmarkdown'), repos='https://cloud.r-project.org')"
# install shinyproxy package with demo shiny application
COPY shinyproxy /shinyproxy
RUN R CMD INSTALL /shinyproxy
RUN rm /shinyproxy
# set host and port
COPY Rprofile.site /usr/lib/R/etc/
EXPOSE 3838
ENV PORT=3839
CMD ["R", "-e", "shinyproxy::run_01_hello(as.numeric(Sys.getenv(\"PORT\")))"]
奇点定义/配方文件Singularity.recipe
:
Bootstrap: docker
From: kfoltynski/shinyproxy-demo:singularity
%environment
export PORT=3839
%runscript
echo "Running Shiny app on port $*"
exec R -e "shinyproxy::run_01_hello($@)"
构建奇点图像shiny.simg
:
sudo singularity build shiny.simg Singularity.recipe
运行容器:
singularity run shiny.simg 3839 # app is available on port 3839
将容器作为实例运行:
singularity instance start shiny.simg shiny 3839 # app is not available on port 3839
为什么将奇异容器作为实例运行时应用程序不可用?