Looking to place Ansible in a container (i.e. run Ansible in a container to manage other stuff).
If you want to exclude items from the Docker build place the details of them in a .dockerignore file, then make sure to put the .dockerignore file into a .gitignore file as well.
Docker container - https://hub.docker.com/repository/docker/geektechstuff/ansible_container
Blog post at: https://geektechstuff.com/2020/02/10/ansible-in-a-docker-container/