Another question how does the first compromise happens? The user has to execute the executable file right? I believed (still do), no malwares can infect the system on it's own. The user has to run it no matter what for it to spread! I could be wrong though, correct me if that's the case..
Regarding the Docker API, I'm probably at the same level as you. I use Docker a bit, can't say, I'm very experienced. I would have to dig up details why and how to expose Docker API for remote access. I'm pretty sure this isn't something that's available by default. That would be crazy... not that there're other crazy things out there by default.

For first compromise I can imagine different scenarios, by no means complete:
- execution of an unchecked and already compromised and/or malicious container
- what you already proposed: execution of malware to infect a system by careless user on target system
- possibly zero-day or simply unpatched vulnerability which allows unattended RCE (remote code execution) on target system.
This would allow to compromise a system without any user interaction (worst case).
I'm just listing the very obvious. I'm no malware researcher, I'm just curious and interested in this field to gain knowledge on how to protect myself and my devices.