July 2017
Intermediate to advanced
266 pages
6h 36m
English
Launching Docker containers using Ansible can be achieved via the Ansible Docker task. In the following example, we launch a Docker container for mysql. Let's take a look:
# The following task launches a mysql docker container- name: MySQL Database Container Launch docker: name: database image: mysql:1.0 state: started
From the preceding example, we can see the task launches a MySQL Docker container (version 1.0). The primary parameters we used in this task are image and name. These parameters define the image and tag for the task to use and what we want to title the container we are managing.
The key to launching the container is the started state. State in this context provides the following switches: ...
Read now
Unlock full access