在windows上安装Docker失败

2024-10-02 08:14:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用以下Dockerfile构建图像:

FROM ubuntu:18.04

RUN apt-get update \
  && apt-get install -y python3-pip python3-dev \
  && cd /usr/local/bin \
  && ln -s /usr/bin/python3 python \
  && pip3 install --upgrade pip

# Setup the Python's configs
RUN pip install --upgrade pip && \
    pip install --no-cache-dir matplotlib==3.0.2 pandas==0.23.4 numpy==1.16.3 && \
    pip install --no-cache-dir pybase64 && \
    pip install --no-cache-dir scipy && \
    pip install --no-cache-dir dask[complete] && \
    pip install --no-cache-dir dash==1.6.1 dash-core-components==1.5.1 dash-bootstrap-components==0.7.1 dash-html-components==1.0.2 dash-table==4.5.1 dash-daq==0.2.2 && \
    pip install --no-cache-dir plotly && \
    pip install --no-cache-dir adjustText && \
    pip install --no-cache-dir networkx && \
    pip install --no-cache-dir scikit-learn && \
    pip install --no-cache-dir tzlocal

# Setup the R configs
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
RUN apt update
ENV DEBIAN_FRONTEND=noninteractive 
RUN apt install -y r-base
RUN pip install rpy2==2.9.4
RUN apt-get -y install libxml2 libxml2-dev libcurl4-gnutls-dev libssl-dev
RUN echo "r <- getOption('repos'); r['CRAN'] <- 'https://cran.r-project.org'; options(repos = r);" > ~/.Rprofile
RUN Rscript -e "install.packages('BiocManager')"
RUN Rscript -e "BiocManager::install('ggplot2')"
RUN Rscript -e "BiocManager::install('DESeq2')"
RUN Rscript -e "BiocManager::install('RColorBrewer')"
RUN Rscript -e "BiocManager::install('ggrepel')"
RUN Rscript -e "BiocManager::install('factoextra')"
RUN Rscript -e "BiocManager::install('FactoMineR')"
RUN Rscript -e "BiocManager::install('apeglm')"

当我在Linux上构建这个应用程序时,我从容器中启动了web应用程序,它运行良好。 但是,当我使用Docker Toolbox在windows上构建此应用程序时,尽管factoextra和FactoMineR的安装成功,但当我启动web应用程序时,它会引发一个错误:

Error in library("factoextra") : there is no package called ‘factoextra’

你知道是什么导致了这个问题吗?这是非常奇怪的,因为当我构建映像时,这两个包的安装似乎成功


Tags: installpipnorundev应用程序cacheget

热门问题