【发布时间】:2019-03-23 12:09:28
【问题描述】:
我将一个闪亮的应用程序容器化并尝试使用 Kubernetes 将其部署在 GCP 上,但每次我获取外部 IP 地址并将其加载到浏览器中时,都会收到“无法访问此站点连接被拒绝”错误。因此,我尝试在本地主机上运行容器进行故障排除,现在我收到“127.0.0.1 未发送任何数据。ERR_EMPTY_RESPONSE”错误。我不知疲倦地在网上搜索解决方案,但似乎没有什么对我有用。另外,没有一个解决方案适用于闪亮的应用程序 docker 容器。许多修复都提到了端口,但我仍然卡住了。顺便说一句,我在我的 Mac 上安装了 xampp。 xampp 和我的 docker 容器是否有可能尝试共享同一个端口,或者我的 Docker 文件代码有问题?请原谅我,但我是容器新手,到目前为止只遵循文档程序。下面是我的 Docker 文件代码:
Dockerfile
# Install R version 3.5.1
FROM r-base:3.5.1
# Install Ubuntu packages
RUN apt-get update && apt-get install -y \
sudo \
gdebi-core \
pandoc \
pandoc-citeproc \
libcurl4-gnutls-dev \
libcairo2-dev/unstable \
libxt-dev \
libssl-dev
# Download and install ShinyServer (latest version)
RUN wget --no-verbose https://s3.amazonaws.com/rstudio-shiny-server-os-
build/ubuntu-12.04/x86_64/VERSION -O "version.txt" && \
VERSION=$(cat version.txt) && \
wget --no-verbose "https://s3.amazonaws.com/rstudio-shiny-server-os-
build/ubuntu-12.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb &&
\
gdebi -n ss-latest.deb && \
rm -f version.txt ss-latest.deb
# Install R packages that are required
# TODO: add further package if you need!
RUN R -e
"install.packages(c('shiny','shinyjs','tools','foreign','XLConnect'),
repos='http://cran.rstudio.com/')"
# 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 ["/usr/bin/shiny-server.sh"]
如果有人可以帮助我,我将不胜感激。
【问题讨论】:
-
那里有is 一个工作的 Docker 镜像,为什么要创建自己的?
标签: docker shiny dockerfile google-kubernetes-engine