github.com/ratanraj/packer@v1.3.2/website/source/docs/post-processors/compress.html.md (about)

     1  ---
     2  description: |
     3      The Packer compress post-processor takes an artifact with files (such as from
     4      VMware or VirtualBox) and compresses the artifact into a single archive.
     5  layout: docs
     6  page_title: 'Compress - Post-Processors'
     7  sidebar_current: 'docs-post-processors-compress'
     8  ---
     9  
    10  # Compress Post-Processor
    11  
    12  Type: `compress`
    13  
    14  The Packer compress post-processor takes an artifact with files (such as from
    15  VMware or VirtualBox) and compresses the artifact into a single archive.
    16  
    17  ## Configuration
    18  
    19  ### Optional:
    20  
    21  By default, packer will build archives in `.tar.gz` format with the following
    22  filename: `packer_{{.BuildName}}_{{.BuilderType}}`. If you want to change this
    23  you will need to specify the `output` option.
    24  
    25  -   `output` (string) - The path to save the compressed archive. The archive
    26      format is inferred from the filename. E.g. `.tar.gz` will be a
    27      gzipped tarball. `.zip` will be a zip file. If the extension can't be
    28      detected packer defaults to `.tar.gz` behavior but will not change
    29      the filename.
    30  
    31      You can use `{{.BuildName}}` and `{{.BuilderType}}` in your output path. If
    32      you are executing multiple builders in parallel you should make sure
    33      `output` is unique for each one. For example `packer_{{.BuildName}}.zip`.
    34  
    35  -   `format` (string) - Disable archive format autodetection and use provided
    36      string.
    37  
    38  -   `compression_level` (number) - Specify the compression level, for
    39      algorithms that support it, from 1 through 9 inclusive. Typically higher
    40      compression levels take longer but produce smaller files. Defaults to `6`
    41  
    42  -   `keep_input_artifact` (boolean) - Keep source files; defaults to `false`
    43  
    44  ### Supported Formats
    45  
    46  Supported file extensions include `.zip`, `.tar`, `.gz`, `.tar.gz`, `.lz4` and
    47  `.tar.lz4`. Note that `.gz` and `.lz4` will fail if you have multiple files to
    48  compress.
    49  
    50  ## Examples
    51  
    52  Some minimal examples are shown below, showing only the post-processor
    53  configuration:
    54  
    55  ``` json
    56  {
    57    "type": "compress",
    58    "output": "archive.tar.lz4"
    59  }
    60  ```
    61  
    62  ``` json
    63  {
    64    "type": "compress",
    65    "output": "{{.BuildName}}_bundle.zip"
    66  }
    67  ```
    68  
    69  ``` json
    70  {
    71    "type": "compress",
    72    "output": "log_{{.BuildName}}.gz",
    73    "compression_level": 9
    74  }
    75  ```