gpt4 book ai didi

Docker 中的 R 安装卡在地理区域

转载 作者:行者123 更新时间:2023-12-04 18:26:32 31 4
gpt4 key购买 nike

我正在使用以下语句在 docker 中安装 R。

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
littler \
r-cran-littler \
r-base \
r-base-dev \
r-recommended \
&& echo 'options(repos = c(CRAN = "https://cloud.r-project.org/"), download.file.method = "libcurl")' >> /etc/R/Rprofile.site \
&& echo 'source("/etc/R/Rprofile.site")' >> /etc/littler.r \
&& ln -s /usr/share/doc/littler/examples/install.r /usr/local/bin/install.r \
&& ln -s /usr/share/doc/littler/examples/install2.r /usr/local/bin/install2.r \
&& ln -s /usr/share/doc/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
&& ln -s /usr/share/doc/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
&& install.r docopt \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
&& rm -rf /var/lib/apt/lists/*

它提出了一系列问题。首先它卡住了,我不知道为什么:
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

1. Africa 4. Australia 7. Atlantic 10. Pacific 13. Etc
2. America 5. Arctic 8. Europe 11. SystemV
3. Antarctica 6. Asia 9. Indian 12. US

我回答以下但没有任何 react :
Geographic area: 8

完整的 dockerfile 是:
#Main docke image
FROM ubuntu
#Los automatically thrown to the I/O strem and not buffered.
ENV PYTHONUNBUFFERED 1
#Set pythonpath (where python search code)
ARG AIRFLOW_VERSION=1.10.9
ARG AIRFLOW_USER_HOME=/usr/local/airflow

ENV AIRFLOW_HOME=${AIRFLOW_USER_HOME}
ENV PYTHONPATH "${PYTHONPATH}:/"
#Allow airflow GPL dependencies
ENV SLUGIFY_USES_TEXT_UNIDECODE=yes




#Install libraries and dependencies
RUN apt-get update && apt-get install -y python3-pip mysql-server vim
RUN apt-get install -y unzip wget
# Set the locale
RUN apt-get clean && apt-get update && apt-get install -y locales
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8


RUN set -ex \
&& buildDeps=' \
freetds-dev \
libkrb5-dev \
libsasl2-dev \
libssl-dev \
libffi-dev \
libpq-dev \
git \
'&& apt-get update -yqq \
&& apt-get upgrade -yqq \
&& apt-get install -yqq --no-install-recommends \
$buildDeps \
freetds-bin \
build-essential \
default-libmysqlclient-dev \
apt-utils \
curl \
rsync \
netcat \
locales \
zip \
&& sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
#&& useradd -ms /bin/bash -d ${AIRFLOW_USER_HOME} airflow \
&& pip install -U setuptools wheel\
&& pip install pytz \
&& pip install pyOpenSSL \
&& pip install ndg-httpsclient \
&& pip install pyasn1 \
&& pip install apache-airflow[crypto,postgres,ssh,s3]==${AIRFLOW_VERSION} \
&& pip install 'redis==3.2' \
&& if [ -n "${PYTHON_DEPS}" ]; then pip install ${PYTHON_DEPS}; fi \
&& apt-get purge --auto-remove -yqq $buildDeps \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
littler \
r-cran-littler \
r-base \
r-base-dev \
r-recommended \
&& echo 'options(repos = c(CRAN = "https://cloud.r-project.org/"), download.file.method = "libcurl")' >> /etc/R/Rprofile.site \
&& echo 'source("/etc/R/Rprofile.site")' >> /etc/littler.r \
&& ln -s /usr/share/doc/littler/examples/install.r /usr/local/bin/install.r \
&& ln -s /usr/share/doc/littler/examples/install2.r /usr/local/bin/install2.r \
&& ln -s /usr/share/doc/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
&& ln -s /usr/share/doc/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
&& install.r docopt \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
&& rm -rf /var/lib/apt/lists/*

WORKDIR "/"
ENTRYPOINT ["/entrypoint.sh"]
#arg to entrypoint
CMD ["webserver"]

最佳答案

这是一个标准的 Debian 功能,它需要这些信息。您可以通过关闭交互模式在任何脚本安装中强制覆盖。在通过 ENV 工作的 Dockerfile 中关键词:

ENV DEBIAN_FRONTEND noninteractive
我确实在 Rocker 项目的一些 Dockerfile 中使用了它:
edd@rob:~$ grep DEBIAN git/rocker/*/Dockerfile git/rocker/*/*/Dockerfile 
git/rocker/r-devel/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-apt/bionic/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-apt/cosmic/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-apt/disco/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-bspm/bionic/Dockerfile:#ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-bspm/focal/Dockerfile:#ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-bspm/testing/Dockerfile:#ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-rspm/bionic/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-rspm/focal/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-ubuntu/bionic/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
git/rocker/r-ubuntu/focal/Dockerfile:ENV DEBIAN_FRONTEND noninteractive
edd@rob:~$
顺便说一句,您问题中的 Dockerfile 似乎是我的直接副本。很高兴看到它被使用,如果您评论一下您的来源可能会更好......

关于Docker 中的 R 安装卡在地理区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62299928/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com