@Anon apologies that this post was not addressed earlier.
Endpoint Security cannot be run inside of a docker container because it needs full access to the underlying OS in order to operate properly.
Elastic Agent by itself can be run in docker, but in order to use Endpoint, you will need to be outside of a container on an actual machine or VM.