Just for arguments sake, how did you install docker engine? Did you add their apt source where they can push anything they like into their packages?
And also, you shouldn’t rely on docker for safety, it might or might not work but docker isn’t a reason to just run an untrusted program.