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 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 /
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.
bash
, however as you can see from the error message, dockerRUN
is using/bin/sh
- which does not recognize thesource
command