Skip to content

Commit

Permalink
Improve CLI usage docs (#559)
Browse files Browse the repository at this point in the history
* Remove example, improve structure, fix typo
  • Loading branch information
Andersson007 authored Jun 14, 2023
1 parent b73f65d commit ec99827
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,23 @@ Ansible Builder can execute two separate steps. The first step is to create a bu
The ``build`` command
---------------------

The ``ansible-builder build`` command takes an execution environment definition file as an input. It outputs a build instruction file (Containerfile for Podman, Dockerfile for Docker), creates the build context necessary for building an execution environment image, and builds that image. The image can be re-built with the build context elsewhere, and give the same result. By default, it looks for a file named ``execution-environment.yml`` in the current directory.
The ``ansible-builder build`` command:

This example uses the following ``execution-environment.yml``
file as a starting point:
* takes an :ref:`execution environment definition file<builder_ee_definition>` as an input,
* outputs a build instruction file (Containerfile for Podman, Dockerfile for Docker),
* creates a build context necessary for building an execution environment image,
* builds the image.

.. code:: yaml
---
version: 3
dependencies:
galaxy: requirements.yml
The content of ``requirements.yml``:

.. code:: yaml
---
collections:
- name: awx.awx
By default, it looks for a file named ``execution-environment.yml`` in the current directory.

To build an execution environment using the files above, run:
To build an execution environment using the default definition file, run:

.. code::
$ ansible-builder build
...
STEP 7: COMMIT my-awx-ee
--> 09c930f5f6a
09c930f5f6ac329b7ddb321b144a029dbbfcc83bdfc77103968b7f6cdfc7bea2
Complete! The build context can be found at: context
Running command:
podman build -f context/Containerfile -t ansible-execution-env:latest context
Complete! The build context can be found at: /path/to/context
Ansible Builder produces a ready-to-use container image and preserves the build context, which you can use to rebuild the image at a different time and/or location with the tooling of your choice.

Expand Down Expand Up @@ -219,7 +205,7 @@ Controls the final image layer squashing. Valid values are:

.. note::

This flag is compatible only with the ``podman`` runtime and will be ignored for any other runtime. Docker does not suport layer squashing; it is considered an experimental feature.
This flag is compatible only with the ``podman`` runtime and will be ignored for any other runtime. Docker does not support layer squashing; it is considered an experimental feature.


The ``create`` command
Expand Down

0 comments on commit ec99827

Please sign in to comment.