【发布时间】:2019-09-24 11:08:47
【问题描述】:
我有一个 R 管道工服务器,我想使用 docker 容器运行它,到目前为止我的 dockerfile 中有这个配置
FROM rocker/r-ver:3.5.0
#update OS and install linux libraries needed to run plumber
RUN apt-get update -qq && apt-get install -y \
libssl-dev \
libcurl4-gnutls-dev
#load in dependencies from 00_Libraries.R file
RUN R -e "install.packages('plumber')"
#Copy all files from current directory
COPY / /
#Expose port :80 for traffic
EXPOSE 80
#when the container starts, start the runscript.R script
ENTRYPOINT ["Rscript", "runscript.R"]
在我的 runscript.R 文件中,我的服务器配置如下:
pr <- plumber::plumb("/home/kristoffer/Desktop/plumber-api/rfiles/plumber.R")$run(port=8000)
每当我尝试运行 docker 映像时,我都会收到此错误:
File does not exist: /home/kristoffer/Desktop/plumber-api/rfiles/plumber.R
Execution halted
我已确保所有必要的文件都位于正确的目录中。
编辑: 我在我的目录中包含了所有文件的图像,以确保 dockerfile 与我的其他文件位于同一目录中
【问题讨论】:
-
@LinPy 不幸的是它仍然找不到文件