【发布时间】:2020-05-02 16:12:42
【问题描述】:
我已经使用docker shiny image 设置了一个闪亮的应用程序,并且在我尝试使用 httr 包调用 API 之前一切正常。据我所知,我无法从应用程序访问互联网,因为我从多个站点收到超时消息,并通过网络浏览器验证了工作。想知道我需要更改什么设置?
从应用内的 RStudio 控制台:
> library(httr)
> r <- GET("http://httpbin.org/get")
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached: [httpbin.org] Connection timed out after 10000 milliseconds
这是我的 DockerFile:
FROM rocker/tidyverse
RUN apt-get update
RUN apt-get install -y libpq-dev
RUN R -e 'install.packages("RPostgres")'
RUN R -e 'install.packages("DT")'
【问题讨论】: