Build Docker Images with Ansible + Vagrant
If it's within scope, I would use Packer to build the artifacts.


Write a Packer template using the builders that you want:


Vagrant builder for the Vagrant image
Docker builder for the Docker image.

Use the same Ansible playbook as you already have to provision each of the builders.


Note that you need to make sure that the Ansible playbook will work in both types of virtualised environments.

This has the benefit of producing arbitrary types of artifacts, based off of a single input. You can use a single workflow for both the Vagrant and the Docker images, and they will be built off of the same state of the codebase (i.e. git hash).