【发布时间】:2018-05-29 08:23:30
【问题描述】:
我正在编写一个 Dockerfile,并想知道如何正确添加一个带有 R 预编译 cran 包的 ppa。 我的以下代码给出了错误消息:
正在阅读包裹清单...
W:存储库“http://ppa.launchpad.net/marutter/c2d4u/ubuntucosmic Release”没有发布文件。
E: 无法获取http://ppa.launchpad.net/marutter/c2d4u/ubuntu/dists/cosmic/main/binary-amd64/Packages 404 Not Found
E: 部分索引文件下载失败。它们已被忽略,或使用旧的。
我不明白他为什么找不到,虽然我可以找到Release文件here。
我的基础镜像是postgres,你可以把它拉成
docker pull postgres
我在添加 PPA 后调用 RUN apt-get update 时遇到错误:
# Load base image
FROM postgres
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get install -y apt-transport-https
RUN apt-get update
RUN apt-get install -y wget
# More stuff here
RUN apt-get install -y r-base r-base-dev
# add cran mirror
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
RUN echo "deb-src https://cran.rstudio.com/bin/linux/ubuntu xenial/" | tee -a /etc/apt/sources.list
# add PPA with pre-compiled cran packages
RUN add-apt-repository -y ppa:marutter/c2d4u
# install some R packages
RUN apt-get update
RUN apt-get install -y r-cran-data.table
RUN apt-get install -y r-cran-tidyverse
如果我不打电话给RUN apt-get update,他不会找到tidyverse(但会找到data.table)
【问题讨论】:
标签: r bash docker dockerfile cran