Error :"the command '/bin/sh -c source protected-env/bin/activate' returned a non-zero code: 127" while I'm trying to configure my first dockerfile

I'm trying to learn docker. This is my first experiment. I have written this 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 \ && 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 /

Unfortunately it does not work. This is the error that I'm getting :

The command '/bin/sh -c source protected-env/bin/activate' returned a non-zero code: 127

the wrong line is this :

RUN source protected-env/bin/activate

Do you have any idea about how to fix it ? thanks.

5 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like