Python ARM in Docker - Installing requirements takes ages
As @Itamar Turner-Trauring mentioned, matplotlib, numpy, pandas and many more libraries store wheels for aarch64 as well as for x86.
In my case, pip was downloading the x86 wheels by default, and then it must compile them during the build and it takes ages.
After changing the pandas version I was using from 1.1.5 to 1.3.5, pip logs changed
from:
Downloading https://****/pypi/download/pandas/1.1.5/pandas-1.1.5.tar.gz (5.2 MB)
To:
Downloading https://****/pypi/download/pandas/1.3.5/pandas-1.3.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.9 MB)
And the entire build time changed from 58 to 8 minutes.
I want to run a Docker container with some Python bots inside. These scripts need libraries like pandas, numpy and matplotlib.
Everything works great in an x86 environment, but building the image on a Arm environment takes ages.
From what I understood, it seems like it needs to compile the libraries for Arm instead of just downloading the compiled files. I am trying to find a way to avoid all of this.

Matplotlib, pandas, numpy: They're pretty heavy packages, but I need just a few functionalities. Is the a slim version of these libraries?
Any way to store the compiled stuff in a permanent cache somewhere in the pipeline? (I am using both GitHub and GitLab to build this)

Any help is appreciated
Regards