They do complement one another but docker has tooling that solves similar problems. Does docker-compose (https://docs.docker.com/compose/) fit your needs?
You wouldn't use docker to manage the host networking (which is where ansible comes in), but packaging whatever is listening on ports as a container works really well for me