'Is it possible to add a specific agent(VM) to Jenkins master that spins up as a docker image?

I am new to docker and haven't used much as yet. I have an existing setup where a Jenkins master(VM) has agents(which have SSH keys) to deploy builds via ansible

Is it possible for me to spin up a new Jenkins master as a docker image and add the existing agents(VM's) to this docker(Jenkins Master) to use it for deployments?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source