• Infrastructure
    • terraform
    • packer
  • Networking
    • consul
  • Security
    • vault
    • boundary
  • Applications
    • nomad
    • waypoint
    • vagrant
  • HashiCorp Cloud Platform

    A fully managed platform to automate infrastructure on any cloud with HashiCorp products.

    • consul
    • terraform
    • vault
    • packerbeta
    Visit cloud.hashicorp.com
  • Overview
  • Tutorials
  • Docs
  • Plugins
  • Community
GitHubInstall PackerTry HCP Packer
  • About External Plugins

      • 1&1
      • Alicloud ECS
      • Alicloud Import
      • Anka Registry Push
      • VM Clone
      • VM Create
      • Ansible (Remote)
      • Ansible Local
      • Overview
      • Amazon AMI
      • Parameter Store
      • Secrets Manager
      • Overview
      • chroot
      • EBS
      • EBS Surrogate
      • EBS Volume
      • Instance
      • Amazon Import
      • Overview
      • ARM
      • chroot
      • DTL
      • Azure DTL Artifact
      • Chef Client
      • Chef Solo
      • CloudStack
      • Converge
      • digitalocean
      • digitalocean-import
      • Docker
      • Docker Import
      • Docker Push
      • Docker Save
      • Docker Tag
      • Overview
      • Commit
      • Repository
      • Tree
      • Google Cloud Platform
      • googlecompute-export
      • googlecompute-import
      • Overview
      • Receipt
      • Overview
      • Toppings
      • Overview
      • Coffees
      • Ingredients
      • Overview
      • Order
      • Hetzner Cloud
      • HuaweiCloud
      • HyperOne
      • Overview
      • ISO
      • VMCX
      • InSpec
      • JDCloud
      • Kamatera
      • Linode
      • Libvirt
      • LXC
      • LXD
      • Naver Cloud
      • OpenStack
      • Overview
      • Classic
      • OCI
      • Overview
      • BSU
      • BSU Surrogate
      • BSU Volume
      • chroot
      • Overview
      • ISO
      • PVM
      • ProfitBricks
      • Overview
      • Clone
      • ISO
      • Puppet Masterless
      • Puppet Server
      • QEMU
      • Salt Masterless
      • Scaleway
      • SSH Key
      • Tencent Cloud
      • Triton
      • UCloud
      • UCloud Import
      • upcloud
      • upcloud-import
      • Vagrant
      • Vagrant
      • Vagrant Cloud
      • Overview
      • ISO
      • OVF
      • VM
      • Overview
      • Clone
      • ISO
      • vSphere
      • vSphere Template
      • Overview
      • ISO
      • VMX
      • Vultr
      • Yandex
      • yandex-export
      • yandex-import
Type '/' to Search
Official
HCP Packer Ready
v1.0.5

Docker Tag Post-Processor

Type: docker-tag

The Packer Docker Tag post-processor takes an artifact from the docker builder that was committed and tags it into a repository. This allows you to use the other Docker post-processors such as docker-push to push the image to a registry.

This is very similar to the docker-import post-processor except that this works with committed resources, rather than exported.

Configuration

The configuration for this post-processor requires repository, all other settings are optional.

  • repository (string) - The repository of the image.

  • tags (array of strings) - A list of tags for the image. By default this is not set. Example of declaration: "tags": ["mytag-1", "mytag-2"]

  • force (boolean) - If true, this post-processor forcibly tag the image even if tag name is collided. Default to false. But it will be ignored if Docker >= 1.12.0 was detected, since the force option was removed after 1.12.0. reference

  • keep_input_artifact (boolean) - Unlike most other post-processors, the keep_input_artifact option will have no effect for the docker-tag post-processor. We will always retain the input artifact for docker-tag, since deleting the image we just tagged is not a behavior anyone should ever expect. keep_input_artifact will therefore always be evaluated as true, regardless of the value you enter into this field.

Example

An example is shown below, showing only the post-processor configuration:

{
  "type": "docker-tag",
  "repository": "hashicorp/packer",
  "tags": ["0.7", "anothertag"]
}
{
  "type": "docker-tag",
  "repository": "hashicorp/packer",
  "tags": ["0.7", "anothertag"]
}

This example would take the image created by the Docker builder and tag it into the local Docker process with a name of hashicorp/packer:0.7.

Following this, you can use the docker-push post-processor to push it to a registry, if you want.

github logoEdit this page
IntroGuidesDocsCommunityPrivacySecurityPress KitConsent Manager