2014-01-19 23:42:42 -05:00
|
|
|
---
|
2017-06-14 21:04:16 -04:00
|
|
|
description: |
|
|
|
|
The Packer Docker import post-processor takes an artifact from the docker
|
|
|
|
builder and imports it with Docker locally. This allows you to apply a
|
|
|
|
repository and tag to the image and lets you use the other Docker
|
|
|
|
post-processors such as docker-push to push the image to a registry.
|
2015-07-22 22:31:00 -04:00
|
|
|
layout: docs
|
2017-06-14 21:04:16 -04:00
|
|
|
page_title: 'Docker Import - Post-Processors'
|
|
|
|
sidebar_current: 'docs-post-processors-docker-import'
|
2017-03-25 18:13:52 -04:00
|
|
|
---
|
2014-01-19 23:42:42 -05:00
|
|
|
|
|
|
|
# Docker Import Post-Processor
|
|
|
|
|
|
|
|
Type: `docker-import`
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The Packer Docker import post-processor takes an artifact from the [docker
|
|
|
|
builder](/docs/builders/docker.html) and imports it with Docker locally. This
|
|
|
|
allows you to apply a repository and tag to the image and lets you use the other
|
|
|
|
Docker post-processors such as
|
|
|
|
[docker-push](/docs/post-processors/docker-push.html) to push the image to a
|
|
|
|
registry.
|
2014-01-19 23:42:42 -05:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2017-05-09 14:37:49 -04:00
|
|
|
The configuration for this post-processor only requires a `repository`, a `tag`
|
|
|
|
is optional.
|
2014-01-19 23:42:42 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `repository` (string) - The repository of the imported image.
|
2014-01-19 23:42:42 -05:00
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
- `tag` (string) - The tag for the imported image. By default this is not set.
|
2014-01-19 23:42:42 -05:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
An example is shown below, showing only the post-processor configuration:
|
|
|
|
|
2017-06-14 21:04:16 -04:00
|
|
|
``` json
|
2014-01-19 23:42:42 -05:00
|
|
|
{
|
|
|
|
"type": "docker-import",
|
2017-06-25 22:34:23 -04:00
|
|
|
"repository": "hashicorp/packer",
|
2014-01-19 23:42:42 -05:00
|
|
|
"tag": "0.7"
|
|
|
|
}
|
2014-10-20 13:55:16 -04:00
|
|
|
```
|
2014-01-19 23:42:42 -05:00
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
This example would take the image created by the Docker builder and import it
|
2017-06-25 22:34:23 -04:00
|
|
|
into the local Docker process with a name of `hashicorp/packer:0.7`.
|
2014-01-19 23:42:42 -05:00
|
|
|
|
|
|
|
Following this, you can use the
|
2015-07-22 22:31:00 -04:00
|
|
|
[docker-push](/docs/post-processors/docker-push.html) post-processor to push it
|
|
|
|
to a registry, if you want.
|