if [ ${#} -ne 1 ]; then echo "The 1st parameter must be the requirements.txt file." exit -1 fi # Find the path to the device server's requirements.txt file # on the Docker's host but relative to the /hosthome directory # in Docker the user's # mounted ${HOME}). # ATTENTION # This is assuming that the device server's requirements.txt file # exists # on the Docker's host in the user's ${HOME} directory. requirements=$(basename ${1}) echo ${requirements} if [ -f ${requirements} ]; then myDir=${PWD} else myDir=${PWD}/$(dirname ${1}) fi requirementsPath=${myDir//${HOME}\//\/hosthome\/} docker exec -it itango python3 -m pip install -r ${requirementsPath}/${requirements}