Integration Of Docker With Ansible

mayank agrawal
2 min readAug 2, 2020

--

This is my first task of ansible, where i launch docker with ansible. I created ansible playbook that runs tasks to configure docker with ansible.

Step 1: First we have to configure the ansible configuration file . we have to tell the inventory.

Second we create playbook where we write all the tasks.

First we configure dns server.

Second configure yum

Third we configure docker repo so that we can install docker

After Configuring docker repo we installed the docker in our system and start the docker service

After starting the service we installed pip and docker-py software because these software is required for pulling the image from docker hub

Then, we pull the image from docker hub

Then, We launch the docker container

In my case, we launch the httpd container for this i copied my file to container for web server.

Output:

Thank You !!

#keepsharing #keepcoding #docker #ansible

--

--

mayank agrawal
mayank agrawal

Written by mayank agrawal

I am devops enthusiast always trying to learn new technologies and try to implement in real world to solve real use cases. Creative integrator

No responses yet