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