Compilation fails when done by CI in docker container but locally runs fine

I have a question: are docker images used by different from the ones on docker hub?

This strange question has been born by my issue: when compiling C code locally using python:2.7 docker image, everything works fine. When I am using CI with the same image my compilation fails. (As a side note: it seems that modules calling ptrace() may cause problem, but I guess this should be irrelevant). I use exactly the same commands on container to create dev environment and I can not replicate the issue locally on my systems. However the build always fails on CI. Any ideas or maybe somebody had similar issue in the past? Or maybe the containers used by CI are different? I am not using privilege mode, but since dind is enabled I guess CI must run in privilege mode anyway.