<commit_before>==============
Docker+Ansible
==============

``docker+ansible`` is an utility to streamline the creation of Docker_
images using Ansible_.

The **main goal** of this utility is to allow building images from
small reusable units.  We want to use *composition* rather than
inheritance, as in a regular ``Dockerfile``.


Quickstart
==========

The only dependency is ``docker``.

1. Clone this repository and build the base image with:

   .. code-block:: bash

       $ git clone https://github.com/waltermoreira/dockeransible.git
       $ cd dockeransible/app_builder
       $ make

   This step will create an image with name ``app_builder``.

2. In the ``examples`` directory, create Ansible roles or download
   them from `Ansible Galaxy`_.  Two dummy roles that just create
   files are provided.

   Write or modify the file ``Runfile``, which contains the
   declarations of the exported ports, volumes, entrypoint, and
   default command for your app.

   Run:

   .. code-block:: bash

       $ cd dockeransible/examples
       $ docker run -v $(pwd):/target app_builder install
       $ ./build_app my_app

   Ansible will provision a container with name ``my_app`` with the
   provided roles.  The command ``build_app`` may be run multiple
   times, taking advantage of Ansible idempotency. The roles can be
   changed, added, or deleted in between runs.

   Once the container is in the desired state, run:

   .. code-block:: bash

       $ ./build_app commit my_app

   This step creates the image with name ``my_app``.

3. Test your app:

   .. code-block:: bash

       $ docker run -it my_app<commit_msg>Fix README<commit_after>==============
Docker+Ansible
==============

``docker+ansible`` is an utility to streamline the creation of Docker_
images using Ansible_.

The **main goal** of this utility is to allow building images from
small reusable units.  We want to use *composition* rather than
inheritance, as in a regular ``Dockerfile``.


Quickstart
==========

The only dependency is ``docker``.

1. Clone this repository and build the base image with:

   .. code-block:: bash

       $ git clone https://github.com/waltermoreira/dockeransible.git
       $ cd dockeransible/app_builder
       $ make

   This step will create an image with name ``app_builder``.

2. In the ``examples`` directory, create Ansible roles or download
   them from `Ansible Galaxy`_.  Two dummy roles that just create
   files are provided.

   Write or modify the file ``Runfile``, which contains the
   declarations of the exported ports, volumes, entrypoint, and
   default command for your app.

   Run:

   .. code-block:: bash

       $ cd dockeransible/example
       $ docker run -v $(pwd):/target app_builder install
       $ ./build_app my_app

   Ansible will provision a container with name ``my_app`` with the
   provided roles.  The command ``build_app`` may be run multiple
   times, taking advantage of Ansible idempotency. The roles can be
   changed, added, or deleted in between runs.

   Once the container is in the desired state, run:

   .. code-block:: bash

       $ ./build_app commit my_app

   This step creates the image with name ``my_app``.

3. Test your app:

   .. code-block:: bash

       $ docker run -it my_app


.. _Docker: docker.com
.. _Ansible: ansible.com
.. _Ansible Galaxy: galaxy.ansible.com
{'fraction_non_alphanumeric': 0.10163934426229508, 'fraction_numerical': 0.0017883755588673621, 'mean_word_length': 3.1845386533665834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4752893', 'n_tokens_mistral': 1005, 'n_tokens_neox': 921, 'n_words': 411}