Containerizing Python based AI Model for ARM64 Devices(RaspberyPi )

Dockerize and deploy AI models on ARM64 devices like RaspberryPI
FROM — platform=linux/arm64 debian:stretch-slim
FROM arm64v8/python:3.7.6-buster
COPY . /app
WORKDIR /app
RUN pip3 install --upgrade pip
RUN pip install --upgrade pip setuptools wheel
RUN pip3 install -r requirements.txt
COPY docker_entrypoint.sh /app
RUN chmod +rwx <<python starting file name>>.py
ENTRYPOINT [“python3”]
CMD [“<<python starting file name>>.py”]
EXPOSE 9119
pandas
scikit-learn==0.24.0
flask
datetime
pickle-mixin
  1. Check if the library you are using supports ARM64. In case of scikit learn, ARM64 is supported only from 0.24.0. For your library, it could be different
  2. The docker image creation took close to 3.5 hours in my MacBook pro. So give it some time.
  3. Though quite a few suggestions in stackoverflow recommended to use Python 3.5 , for us it worked only when we specified below platform specific python version arm64v8/python:3.7.6-buster

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store