July 2017
Intermediate to advanced
266 pages
6h 36m
English
Building Docker images from a Dockerfile is a topic we briefly touched on in the previous section, but it deserves a bit more depth. In building a Docker image from a Dockerfile, we can leverage it later. But first, we would need a Dockerfile to make this happen. Let's look at an example of a Dockerfile and then look at how to build it using Ansible:
# This DOCKERFILE creates a docker image with Ubuntu 14.04 and Ansible installed# It also executes a playbook upon startupFROM ansible/ubuntu14.04-ansible:stable# This Defines the location for Ansible playbooks as /srv/exampleADD ansible /srv/exampleWORKDIR /srv/example# Execute Ansible with the playbook's primary entry point as myplaybook.ymlRUN ansible-playbook ...
Read now
Unlock full access