"Illegal instruction (core dumped)" on tensorflow >1.6

I am trying to run import tensorflow on various tensorflow version. The one that I really want to use is 1.13.1.

My CPU is INTEL Xeon Scalable GOLD 6126 – 12 Cores (24 Threads) 2.60GHz.

I’ve already searched for this error on the internet* and most of the time the work-around is to downgrade tensorflow to older versions (typically I tried 1.5.1 and it worked). Sometimes it’s just unresolved**.

But it is possible to really solve the issue?

Here are my output for various versions of tensorflow.

1.13.1

2020-09-18 15:00:16.308205: F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use SSE4.1 instructions, but these aren't available on your machine.
Aborted (core dumped)

1.14.0, 1.15.2 and 2.3.0

Illegal instruction (core dumped)

It seems that building from source could be a solution, but how to do it properly knowing that I want to run the code inside a docker?

*
https://github.com/tensorflow/tensorflow/issues/17411

https://github.com/tensorflow/tensorflow/issues/30114

https://tech.amikelive.com/node-887/how-to-resolve-error-illegal-instruction-core-dumped-when-running-import-tensorflow-in-a-python-program/

Illegal instruction(core dumped) tensorflow

https://www.tutorialexample.com/fix-tensorflow-illegal-instruction-core-dumped-error-a-simple-guide-tensorflow-tutorial/

**
https://github.com/tensorflow/tensorflow/issues/20139

Source: Docker Questions