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