2014-09-05 00:39:18 -04:00
|
|
|
---
|
2020-03-18 18:46:47 -04:00
|
|
|
description: >
|
|
|
|
The Packer Docker Save post-processor takes an artifact from the docker
|
|
|
|
builder
|
|
|
|
|
|
|
|
that was committed and saves it to a file. This is similar to exporting the
|
|
|
|
|
|
|
|
Docker image directly from the builder, except that it preserves the hierarchy
|
|
|
|
|
|
|
|
of images and metadata.
|
|
|
|
page_title: Docker Save - Post-Processors
|
2020-04-02 19:39:47 -04:00
|
|
|
sidebar_title: Docker Save
|
2017-03-25 18:13:52 -04:00
|
|
|
---
|
2014-09-05 00:39:18 -04:00
|
|
|
|
|
|
|
# Docker Save Post-Processor
|
|
|
|
|
|
|
|
Type: `docker-save`
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The Packer Docker Save post-processor takes an artifact from the [docker
|
2020-03-31 17:40:07 -04:00
|
|
|
builder](/docs/builders/docker) that was committed and saves it to a file.
|
2015-07-22 22:31:00 -04:00
|
|
|
This is similar to exporting the Docker image directly from the builder, except
|
|
|
|
that it preserves the hierarchy of images and metadata.
|
2014-09-05 00:39:18 -04:00
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
We understand the terminology can be a bit confusing, but we've adopted the
|
|
|
|
terminology from Docker, so if you're familiar with that, then you'll be
|
|
|
|
familiar with this and vice versa.
|
2014-09-05 00:39:18 -04:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2019-04-03 16:57:22 -04:00
|
|
|
### Required
|
|
|
|
|
2017-05-09 14:37:49 -04:00
|
|
|
The configuration for this post-processor only requires one option.
|
2014-09-05 00:39:18 -04:00
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
- `path` (string) - The path to save the image.
|
2014-09-05 00:39:18 -04:00
|
|
|
|
2019-04-03 16:57:22 -04:00
|
|
|
### Optional
|
|
|
|
|
2020-03-18 18:46:47 -04:00
|
|
|
- `keep_input_artifact` (boolean) - if true, do not delete the docker
|
|
|
|
container, and only save the .tar created by docker save. Defaults to true.
|
2019-04-03 16:57:22 -04:00
|
|
|
|
2014-09-05 00:39:18 -04:00
|
|
|
## Example
|
|
|
|
|
|
|
|
An example is shown below, showing only the post-processor configuration:
|
|
|
|
|
2020-12-21 10:56:12 -05:00
|
|
|
<Tabs>
|
|
|
|
<Tab heading="JSON">
|
|
|
|
|
2020-03-12 10:05:08 -04:00
|
|
|
```json
|
2014-09-05 00:39:18 -04:00
|
|
|
{
|
|
|
|
"type": "docker-save",
|
|
|
|
"path": "foo.tar"
|
|
|
|
}
|
2014-10-20 13:55:16 -04:00
|
|
|
```
|
2020-12-21 10:56:12 -05:00
|
|
|
</Tab>
|
|
|
|
|
|
|
|
<Tab heading="HCL2">
|
|
|
|
|
|
|
|
```hcl
|
2020-12-21 11:01:39 -05:00
|
|
|
post-processors "docker-save" {
|
2020-12-21 10:56:12 -05:00
|
|
|
path = "foo.tar"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
</Tab>
|
|
|
|
</Tabs>
|
|
|
|
|