Strange LD_PRELOAD behavior

I have a strange behavior in different versions of docker.

I run to following:

docker run -it -e LD_PRELOAD=/bin/xyz.so bash env | grep LD_PRELOAD

It runs as expected, and the output is:

LD_PRELOAD=/bin/xyz.so

However, when I run the same command but with another image, such as ubuntu or centos:

docker run -it -e LD_PRELOAD=/bin/xyz.so ubuntu env
docker run -it -e LD_PRELOAD=/bin/xyz.so centos:7 env

The LD_PRELOAD variable does not appear in the output!

This happens with
Docker version 17.12.1-ce, build 7390fc6 @ ubunutu 18.04

More than that. With Docker version 1.13.1, build 092cba3 @ ubuntu 17.10 host it works as expected and with centos and ubuntu images LD_PRELOAD does appear in the output of “env”.

Can someone explain how the same images behave differently on different versions of docker? Why LD_PRELOAD disappears in the newer docker version?

Thanks
B