github.com/aspring/packer@v0.8.1-0.20150629211158-9db281ac0f89/website/source/docs/post-processors/compress.html.markdown (about) 1 --- 2 layout: "docs" 3 page_title: "compress Post-Processor" 4 description: |- 5 The Packer compress post-processor takes an artifact with files (such as from VMware or VirtualBox) and compresses the artifact into a single archive. 6 --- 7 8 # Compress Post-Processor 9 10 Type: `compress` 11 12 The Packer compress post-processor takes an artifact with files (such as from 13 VMware or VirtualBox) and compresses the artifact into a single archive. 14 15 ## Configuration 16 17 ### Required: 18 19 You must specify the output filename. The archive format is derived from the filename. 20 21 * `output` (string) - The path to save the compressed archive. The archive 22 format is inferred from the filename. E.g. `.tar.gz` will be a gzipped 23 tarball. `.zip` will be a zip file. If the extension can't be detected packer 24 defaults to `.tar.gz` behavior but will not change the filename. 25 26 If you are executing multiple builders in parallel you should make sure 27 `output` is unique for each one. For example `packer_{{.BuildName}}_{{.Provider}}.zip`. 28 29 ### Optional: 30 31 If you want more control over how the archive is created you can specify the following settings: 32 33 * `compression_level` (integer) - Specify the compression level, for algorithms 34 that support it, from 1 through 9 inclusive. Typically higher compression 35 levels take longer but produce smaller files. Defaults to `6` 36 37 * `keep_input_artifact` (bool) - Keep source files; defaults to `false` 38 39 ### Supported Formats 40 41 Supported file extensions include `.zip`, `.tar`, `.gz`, `.tar.gz`, `.lz4` and `.tar.lz4`. Note that `.gz` and `.lz4` will fail if you have multiple files to compress. 42 43 ## Examples 44 45 Some minimal examples are shown below, showing only the post-processor configuration: 46 47 ```json 48 { 49 "type": "compress", 50 "output": "archive.tar.lz4" 51 } 52 ``` 53 54 ```json 55 { 56 "type": "compress", 57 "output": "archive.zip" 58 } 59 ``` 60 61 ```json 62 { 63 "type": "compress", 64 "output": "archive.gz", 65 "compression": 9 66 } 67 ```