Skip to content

Commit

Permalink
Split doc to chapters for a better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
isbm committed Nov 23, 2023
1 parent a654703 commit 440b85e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ For example, if your working container is currently mounted as ``/var/tmp/mycont
mezzotint -t -p mycontainer.yaml -r /var/tmp/mycontainer
This operation will calculate what can be classified as a "junk" and will remove it, displaying only what will be staying in your container in a future.

Reviewing "dry-run" Results
^^^^^^^^^^^^^^^^^^^^^^^^^^^

This will perform an excessive output to the terminal, listing all directories and files that will be preserved, calculating their size etc. At the end Mezzotint will print the total results, like how much disk space will be freed and how much space preserved etc. Also Mezzotint will print the list of preserved packages.

For example:
Expand Down Expand Up @@ -304,6 +309,11 @@ The output also found additional 22 junk files. Scrolling this output, they are
╰─ ⚠️ PROBLEMS
Files: 21, Size: 12.2 MB
We are still losing 12 megabytes. Let's get rid of them too.

Tighting It All Up
^^^^^^^^^^^^^^^^^^

These files are occupying 12 megabytes without any kind of practical need. You can choose either to keep these or you can do something about it. One way is to let Mezzotint deal with it, using ``--autodeps`` option with flag ``tight``. This flag tells Mezzotint to actually not to look for dependencies, but only make a container "tight", i.e. remove all data that is considered not important:

.. code-block:: shell
Expand All @@ -318,6 +328,9 @@ This operation will additionally shave off 12Mb from this container. Now it is a

For the reasons that the operation cannot be undone while the entire container might be permanently damaged for different reasons like wrong/incomplete profile, missing packages etc, it is recommended to pre-commit "fat" finished container to the local storage and restore working container from it, using Buildah.

Applying the Changes Permanently
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To apply the changes, simply remove ``--dry-run`` or ``-t`` flag, and re-run Mezzotint:

.. code-block:: shell
Expand All @@ -333,6 +346,11 @@ You should be seeing the following output:
[23/09/2023 13:01:31] - INFO: Automatically removing potential junk resources
[23/09/2023 13:01:31] - INFO: Finished. Hopefully it even works :-)
Hopefully yes. Now it is time to review and test it.

Reviewing the Result
^^^^^^^^^^^^^^^^^^^^

At this point, if you navigate to ``/var/tmp/mycontainer`` and list it, you will see that the root filesystem is significantly smaller than usual:

.. code-block:: text
Expand Down

0 comments on commit 440b85e

Please sign in to comment.