【发布时间】:2019-10-05 00:23:36
【问题描述】:
R 闪亮应用程序的 docker 化过程是通过摇杆/闪亮图像完成的。我需要在 Windows 系统的 R 闪亮应用程序上运行 dockerization。唯一的问题是用于此过程的rocker/shiny 是基于Linux 的容器。因此,我无法生成在我的 Windows 系统上运行的图像。由于安全原因,我不能使用外部 VPS 或 VM。
我曾尝试编写一个可在 Windows 上运行的 docker 文件,但问题是容器是基于 Linux 的。
我的 Dockerfile
FROM rocker/r-ver:3.5.1
#installing R libraries
RUN R -e "install.packages(c('shiny', 'shinydashboard'), repos='http://cran.us.r-project.org')"
# Copy configuration files into the Docker image
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
COPY /app/srv/shiny-server/
# Make the ShinyApp available at port 80
EXPOSE 80
#Copy further configuration files into the Docker image
COPY shiny-server.sh /usr/bin/shiny-server.sh
CMD ['Rscript', 'app_run.R']
(original documentation mentions a .sh file which is not running on my system
because of the Linux windows file path issues)
在那里运行 2 个命令后,我希望我闪亮的应用程序可以在 localhost:8080 上运行
Get-Content Dockerfile | docker build -
docker run --name DOCKERapp -p 8080:8080 <image_name>
【问题讨论】: