错误:“命令 '/bin/sh -c source protected-env/bin/activate' 返回非零代码:127”当我尝试配置我的第一个 dockerfile 时

错误:“命令 '/bin/sh -c source protected-env/bin/activate' 返回非零代码:127”当我尝试配置我的第一个 dockerfile 时

我正在尝试学习docker。这是我的第一次实验。我写了这个dockerfile:

FROM nvidia/cudagl:11.3.0-base-ubuntu20.04

LABEL Author="ZioMario"
LABEL Title="Firefox/Docker20.10.6/Ubuntu20.04"

# Enviorment variables
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PATH "$PATH:/bin/2.82/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
ENV FIREFOX_PATH "/bin/2.82"
ENV FIREFOXPIP "/bin/2.82/python/bin/pip3"
ENV FIREFOXPY "/bin/2.82/python/bin/python3.7m"
ENV HW="GPU"

# Install dependencies
RUN apt-get update && apt-get install -y \ 
    apt-utils \
    wget \ 
    libopenexr-dev \ 
    bzip2 \ 
    build-essential \ 
    zlib1g-dev \ 
    libxmu-dev \ 
    libxi-dev \ 
    libxxf86vm-dev \ 
    libfontconfig1 \ 
    libxrender1 \ 
    libgl1-mesa-glx \ 
    xz-utils \
    firefox \
    openjdk-8-jre

# Download the Python source

RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ 
    && tar -xzf Python-3.7.0.tgz \ 
    && cp -r Python-3.7.0/Include/* $FIREFOX_PATH/python/include/python3.7m/ \ 
    && rm -rf Python-3.7.0.tgz \ 
    && rm -rf Python-3.7.0 

# Installing a modern version of numpy

RUN rm -rf ${FIREFOX_PATH}/python/lib/python3.7/site-packages/numpy 

# Must first ensurepip to install Firefox pip3 and then new numpy

RUN ${FIREFOXPY} -m venv protected-env

RUN source protected-env/bin/activate

RUN ${FIREFOXPY} -m ensurepip && ${FIREFOXPIP} install --upgrade pip && ${FIREFOXPIP} install numpy
RUN deactivate
# Set the working directory
WORKDIR /

不幸的是它不起作用。这是我收到的错误:

命令 '/bin/sh -c source protected-env/bin/activate' 返回非零代码:127

错误的一行是这样的:

运行源 protected-env/bin/activate

您知道如何修复它吗?谢谢。

相关内容