Dockerfiles are useful, but many of the actions performed inside of Dockerfiles could be completed with Ansible instead. Ansible can be used to launch a container using a base image, then interact with that container using the docker connection method to complete the configuration. Let's demonstrate this by repeating the previous example, but without the need for a Dockerfile. Instead, all of the work will be handled by an entirely new playbook named docker-all.yaml. The first part of this playbook starts a container from a preexisting image of Fedora 29 from Docker Hub, and adds the resulting container details to Ansible's in-memory inventory by using add_host:
---- name: build an image hosts: localhost ...