Run shell script file to install from source in Dockerfile
I’m trying to install a python package (daqhats
) from source in a dockerfile, but I’m not getting anywhere. The install instructions are:
cd ~
git clone https://github.com/mccdaq/daqhats.git
cd ~/daqhats
sudo ./install.sh
https://github.com/mccdaq/daqhats#readme
My corresponding dockerfile lines are:
WORKDIR /root
RUN git clone https://github.com/mccdaq/daqhats.git
WORKDIR /root/daqhats
COPY install_nopy2.sh ./
RUN ./install_nopy2.sh
WORKDIR /app
Note: install.sh asks the user if they also want support for python2. install_nopy2.sh is a file I created which bypasses the question so that an input is not required.
When I run this I’m catching an error which states that daqhats shared library is not installed
. Am I missing something in my dockerfile? The package works perfectly when installed directly to my device.
Full Dockerfile:
FROM arm32v7/python:3.7-slim-buster
WORKDIR /app
RUN pip install numpy --extra-index-url https://www.piwheels.org/simple
RUN pip install scipy --extra-index-url https://www.piwheels.org/simple
# missing dependancies for numpy and scipy (and git)
RUN apt-get update && apt-get install -y
libatlas-base-dev
libatlas3-base
git
COPY requirements.txt ./
RUN pip install -r requirements.txt
# install python package for MCC DAQ hat
WORKDIR /root
RUN git clone https://github.com/mccdaq/daqhats.git
WORKDIR /root/daqhats
COPY install_nopy2.sh ./
RUN ./install_nopy2.sh
WORKDIR /app
COPY . .
CMD [ "python3", "-u", "./main.py" ]
Source: Docker Questions