首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在码头上安装本地R库时出错

在码头上安装本地R库时出错
EN

Stack Overflow用户
提问于 2020-11-27 03:29:14
回答 2查看 811关注 0票数 4

我试图部署我的闪亮的应用程序在码头(使用摇滚/闪亮-韵文:3.6.3基本图像),但我面临的问题,当我尝试安装本地(非CRAN)软件包通过码头。当在RStudio中完成安装时,安装工作正常。

  • 码头发动机v19.03.13
  • 操作系统: Windows 10 Enterprise

成功--当我尝试在RStudio中安装本地包时:

代码语言:javascript
复制
> install.packages("<FULLPATH>/customLibrary.zip", repos = NULL, type = "win.binary")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/p/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
package ‘customLibrary’ successfully unpacked and MD5 sums checked

Dockerfile

代码语言:javascript
复制
FROM rocker/shiny-verse:3.6.3
RUN R -e "install.packages('<FULLPATH>/customLibrary.zip', repos = NULL, type = 'win.binary')"
RUN R -e "install.packages(c('gtable', 'data.table', 'shinydashboard', 'ggplot2'), repos='https://cran.rstudio.com', dependencies=FALSE)"
COPY . /srv/shiny-server
EXPOSE 3838

失败-当我使用上述Dockerfile构建我的Docker映像时:

代码语言:javascript
复制
[+] Building 0.8s (6/8)
 => [internal] load build definition from Dockerfile                                                                                                    0.1s
 => => transferring dockerfile: 465B                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                       0.1s
 => => transferring context: 2B                                                                                                                         0.0s
 => [internal] load metadata for docker.io/rocker/shiny-verse:3.6.3                                                                                     0.0s
 => CACHED [1/4] FROM docker.io/rocker/shiny-verse:3.6.3                                                                                                0.0s
 => [internal] load build context                                                                                                                       0.0s
 => => transferring context: 517B                                                                                                                       0.0s
 => ERROR [2/4] RUN R -e "install.packages('<FULLPATH>/customRLibrary.zip', repos = NULL, type = 'win.bin  0.7s
------
 > [2/4] RUN R -e "install.packages('<FULLPATH>/customRLibrary.zip', repos = NULL, type = 'win.binary')":
#5 0.599
#5 0.599 R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
#5 0.599 Copyright (C) 2020 The R Foundation for Statistical Computing
#5 0.599 Platform: x86_64-pc-linux-gnu (64-bit)
#5 0.599
#5 0.599 R is free software and comes with ABSOLUTELY NO WARRANTY.
#5 0.599 You are welcome to redistribute it under certain conditions.
#5 0.599 Type 'license()' or 'licence()' for distribution details.
#5 0.599
#5 0.599 R is a collaborative project with many contributors.
#5 0.599 Type 'contributors()' for more information and
#5 0.599 'citation()' on how to cite R or R packages in publications.
#5 0.599
#5 0.599 Type 'demo()' for some demos, 'help()' for on-line help, or
#5 0.599 'help.start()' for an HTML browser interface to help.
#5 0.599 Type 'q()' to quit R.
#5 0.599
#5 0.723 > install.packages('<FULLPATH>/customRLibrary.zip', repos = NULL, type = 'win.binary')
#5 0.728 Installing package into ‘/usr/local/lib/R/site-library’
#5 0.728 (as ‘lib’ is unspecified)
#5 0.728 Error in install.packages("<FULLPATH>/customRLibrary.zip",  :
#5 0.728   cannot install Windows binary packages on this platform
#5 0.728 Execution halted
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c R -e "install.packages('<FULLPATH>/customRLibrary.zip', repos = NULL, type = 'win.binary')"]: runc did not terminate sucessfully

有人能指出我哪里出了问题吗?蒂娅。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-12-01 00:07:51

在开发软件包的RStudio中,安装devtools,然后运行

代码语言:javascript
复制
devtools::build(binary = FALSE)

它将生成一个可以安装在任何平台上的tar.gz包。

以下是文档:https://rdrr.io/cran/devtools/man/build.html

票数 2
EN

Stack Overflow用户

发布于 2020-12-01 10:55:37

rocker-org/shiny dockerfile构建在Debian上。

这是一个用于Debian稳定服务器的Dockerfile。

查看GitHubDockerHub - 这里是dockerfile。

这意味着对OP的注释是正确的。您正试图在linux上安装windows二进制文件,但它不起作用。因此,你的问题就在这里。

代码语言:javascript
复制
install.packages("<FULLPATH>/customLibrary.zip", repos = NULL, type = "win.binary")

我猜解决方案是为linux编译customLibrary,只需

代码语言:javascript
复制
install.packages("<FULLPATH>/customLibrary.zip", repos = NULL)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65031741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档