dockerfile“软件包“ RODBC”不可用(对于R版本3.6.3)”

时间:2020-08-07 05:15:24

标签: docker ubuntu docker-compose dockerfile rodbc

我经历了一些堆栈解决方案including this one,但无法构建我的Docker映像。此先前工作的图像不再建立。有关如何在R 3.6.3中安装RODBC的任何想法?

这是我的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

## This was not needed before but we need it now
ENV DEBIAN_FRONTEND noninteractive

# Now install R and littler, and create a link for littler in /usr/local/bin
# Default CRAN repo is now set by R itself, and littler knows about it too
# r-cran-docopt is not currently in c2d4u so we install from source
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

#This is required for the R curl package - it fails to install with just libssl1.0
RUN apt-get install -y libssl-dev

RUN install.r tidyr bigrquery dplyr RODBC sqldf readr httr uuid

COPY src/sale_upload_v2.r /usr/local/src/scripts/sale_upload_v2.r
WORKDIR /usr/local/src/scripts

在构建时出现错误消息:

 package ‘RODBC’ is not available (for R version 3.6.3)

0 个答案:

没有答案