在 dockerfile 中 运行 时 "install.packages(RODBC_1.2-6.tar.gz" 中的意外符号

unexpected symbol in "install.packages(RODBC_1.2-6.tar.gz" when running in a dockerfile

我正在尝试通过使用 curl 下载软件包然后使用 install.packages 但我收到以下错误。关于如何实现这一目标的任何想法?

Error: unexpected symbol in "install.packages(RODBC_1.2-6.tar.gz"

在 dockerfile 中,我尝试使用以下 运行 语句执行上述操作:

RUN curl https://cran.r-project.org/src/contrib/Archive/RODBC --output RODBC_1.2-6.tar.gz
RUN  R -e "install.packages(RODBC_1.2-6.tar.gz)" 

完整的 dockerfile 是:

FROM ubuntu:bionic

RUN useradd docker \
        && mkdir /home/docker \
        && chown docker:docker /home/docker \
        && addgroup docker staff

RUN apt-get update \
        && apt-get install -y --no-install-recommends \
                software-properties-common \
                ed \
                less \
                locales \
                vim-tiny \
                wget \
                ca-certificates \
        && add-apt-repository --enable-source --yes "ppa:marutter/rrutter3.5" \
        && add-apt-repository --enable-source --yes "ppa:marutter/c2d4u3.5"

## Configure default locale, see https://github.com/rocker-org/rocker/issues/19
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
        && locale-gen en_US.utf8 \
        && /usr/sbin/update-locale LANG=en_US.UTF-8

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
        && apt-get install -y --no-install-recommends \
                 littler \
                 r-base \
                 r-base-dev \
                 r-recommended \
        && ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \
        && ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \
        && ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
        && ln -s /usr/lib/R/site-library/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/*

RUN apt-get update
#These are all required, the exact version, for SQL Server to work
RUN apt-get install -y gnupg2 libssl1.0 libssl1.0-dev apt-transport-https

RUN apt-get install -y libcurl4-openssl-dev curl

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc unixodbc-dev

RUN apt-get install -y libssl-dev

RUN install.r tidyr bigrquery dplyr sqldf readr httr uuid
RUN curl https://cran.r-project.org/src/contrib/Archive/RODBC --output RODBC_1.2-6.tar.gz
RUN  R -e "install.packages(RODBC_1.2-6.tar.gz)" 
COPY src/upload_v2.r /usr/local/src/scripts/upload_v2.r
WORKDIR /usr/local/src/scripts

运行 R 行中似乎缺少引号:

RUN curl https://cran.r-project.org/src/contrib/Archive/RODBC --output RODBC_1.2-6.tar.gz
RUN R -e "install.packages('RODBC_1.2-6.tar.gz')"