github.com/StackPointCloud/packer@v0.10.2-0.20180716202532-b28098e0f79b/website/source/docs/commands/push.html.md (about) 1 --- 2 description: | 3 The `packer push` command uploads a template and other required files to the 4 Atlas build service, which will run your packer build for you. 5 layout: docs 6 page_title: 'packer push - Commands' 7 sidebar_current: 'docs-commands-push' 8 --- 9 10 # `push` Command 11 12 !> The Packer and Artifact Registry features of Atlas will no longer be 13 actively developed or maintained and will be fully decommissioned. 14 Please see our [guide on building immutable infrastructure with 15 Packer on CI/CD](/guides/packer-on-cicd/) for ideas on implementing these 16 features yourself. 17 18 The `packer push` command uploads a template and other required files to the 19 Atlas service, which will run your packer build for you. [Learn more about 20 Packer in Atlas.](https://atlas.hashicorp.com/help/packer/features) 21 22 Running builds remotely makes it easier to iterate on packer builds that are not 23 supported on your operating system, for example, building docker or QEMU while 24 developing on Mac or Windows. Also, the hard work of building VMs is offloaded 25 to dedicated servers with more CPU, memory, and network resources. 26 27 When you use push to run a build in Atlas, you may also want to store your build 28 artifacts in Atlas. In order to do that you will also need to configure the 29 [Atlas post-processor](/docs/post-processors/atlas.html). This is optional, and 30 both the post-processor and push commands can be used independently. 31 32 ~> The push command uploads your template and other files, like provisioning 33 scripts, to Atlas. Take care not to upload files that you don't intend to, like 34 secrets or large binaries. **If you have secrets in your Packer template, you 35 should [move them into environment 36 variables](https://www.packer.io/docs/templates/user-variables.html).** 37 38 Most push behavior is [configured in your packer 39 template](/docs/templates/push.html). You can override or supplement your 40 configuration using the options below. 41 42 ## Options 43 44 - `-token` - Your access token for the Atlas API. Login to Atlas to [generate an 45 Atlas Token](https://atlas.hashicorp.com/settings/tokens). The most convenient 46 way to configure your token is to set it to the `ATLAS_TOKEN` environment 47 variable, but you can also use `-token` on the command line. 48 49 - `-name` - The name of the build in the service. This typically looks like 50 `hashicorp/precise64`, which follows the form `<username>/<buildname>`. This 51 must be specified here or in your template. 52 53 - `-sensitive` - A comma-separated list of variables that should be marked as 54 sensitive in the Terraform Enterprise ui. These variables' keys will be 55 visible, but their values will be redacted. example usage: 56 `-var 'supersecretpassword=mypassword' -sensitive=supersecretpassword1` 57 58 - `-var` - Set a variable in your packer template. This option can be used 59 multiple times. This is useful for setting version numbers for your build. 60 61 - `-var-file` - Set template variables from a file. 62 63 ## Environment Variables 64 65 - `ATLAS_CAFILE` (path) - This should be a path to an X.509 PEM-encoded public 66 key. If specified, this will be used to validate the certificate authority 67 that signed certificates used by an Atlas installation. 68 69 - `ATLAS_CAPATH` - This should be a path which contains an X.509 PEM-encoded 70 public key file. If specified, this will be used to validate the certificate 71 authority that signed certificates used by an Atlas installation. 72 73 ## Examples 74 75 Push a Packer template: 76 77 ``` shell 78 $ packer push template.json 79 ``` 80 81 Push a Packer template with a custom token: 82 83 ``` shell 84 $ packer push -token ABCD1234 template.json 85 ``` 86 87 ## Limits 88 89 `push` is limited to 5gb upload when pushing to Atlas. To be clear, packer *can* 90 build artifacts larger than 5gb, and Atlas *can* store artifacts larger than 91 5gb. However, the initial payload you push to *start* the build cannot exceed 92 5gb. If your boot ISO is larger than 5gb (for example if you are building OSX 93 images), you will need to put your boot ISO in an external web service and 94 download it during the packer run. 95 96 ## Building Private `.iso` and `.dmg` Files 97 98 If you want to build a private `.iso` file you can upload the `.iso` to a secure 99 file hosting service like [Amazon 100 S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html), 101 [Google Cloud 102 Storage](https://cloud.google.com/storage/docs/gsutil/commands/signurl), or 103 [Azure File 104 Service](https://msdn.microsoft.com/en-us/library/azure/dn194274.aspx) and 105 download it at build time using a signed URL. You should convert `.dmg` files to 106 `.iso` and follow a similar procedure. 107 108 Once you have added [variables in your packer 109 template](/docs/templates/user-variables.html) you can specify credentials or 110 signed URLs using Atlas environment variables, or via the `-var` flag when you 111 run `push`. 112 113 