2020-03-18 18:46:47 -04:00
|
|
|
---
|
|
|
|
description: >
|
|
|
|
The digitalocean Packer builder is able to create new images for use with
|
|
|
|
|
|
|
|
DigitalOcean. The builder takes a source image, runs any provisioning
|
|
|
|
necessary
|
|
|
|
|
|
|
|
on the image after launching it, then snapshots it into a reusable image. This
|
|
|
|
|
|
|
|
reusable image can then be used as the foundation of new servers that are
|
|
|
|
|
|
|
|
launched within DigitalOcean.
|
|
|
|
page_title: DigitalOcean - Builders
|
|
|
|
---
|
|
|
|
|
|
|
|
# DigitalOcean Builder
|
|
|
|
|
|
|
|
Type: `digitalocean`
|
2021-02-05 19:49:28 -05:00
|
|
|
Artifact BuilderId: `pearkes.digitalocean`
|
2020-03-18 18:46:47 -04:00
|
|
|
|
|
|
|
The `digitalocean` Packer builder is able to create new images for use with
|
|
|
|
[DigitalOcean](https://www.digitalocean.com). The builder takes a source image,
|
|
|
|
runs any provisioning necessary on the image after launching it, then snapshots
|
|
|
|
it into a reusable image. This reusable image can then be used as the
|
|
|
|
foundation of new servers that are launched within DigitalOcean.
|
|
|
|
|
|
|
|
The builder does _not_ manage images. Once it creates an image, it is up to you
|
|
|
|
to use it or delete it.
|
|
|
|
|
|
|
|
## Configuration Reference
|
|
|
|
|
|
|
|
There are many configuration options available for the builder. They are
|
|
|
|
segmented below into two categories: required and optional parameters. Within
|
|
|
|
each category, the available configuration keys are alphabetized.
|
|
|
|
|
|
|
|
### Required:
|
|
|
|
|
2021-03-10 07:24:00 -05:00
|
|
|
@include 'builder/digitalocean/Config-required.mdx'
|
2020-03-18 18:46:47 -04:00
|
|
|
|
|
|
|
### Optional:
|
|
|
|
|
2021-03-10 07:24:00 -05:00
|
|
|
@include 'builder/digitalocean/Config-not-required.mdx'
|
2020-03-18 18:46:47 -04:00
|
|
|
|
|
|
|
## Basic Example
|
|
|
|
|
|
|
|
Here is a basic example. It is completely valid as soon as you enter your own
|
|
|
|
access tokens:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"type": "digitalocean",
|
|
|
|
"api_token": "YOUR API KEY",
|
|
|
|
"image": "ubuntu-16-04-x64",
|
|
|
|
"region": "nyc3",
|
|
|
|
"size": "512mb",
|
|
|
|
"ssh_username": "root"
|
|
|
|
}
|
|
|
|
```
|
2021-03-10 07:24:00 -05:00
|
|
|
|
|
|
|
### Communicator Config
|
|
|
|
|
|
|
|
In addition to the builder options, a
|
|
|
|
[communicator](/docs/templates/legacy_json_templates/communicator) can be configured for this builder.
|
|
|
|
|
|
|
|
@include 'packer-plugin-sdk/communicator/Config-not-required.mdx'
|
|
|
|
|
|
|
|
@include 'packer-plugin-sdk/communicator/SSH-not-required.mdx'
|
|
|
|
|
2021-03-31 15:07:00 -04:00
|
|
|
@include 'packer-plugin-sdk/communicator/SSH-Private-Key-File-not-required.mdx'
|