This is a Packer build of Grist that generates virtual machine images for cloud providers. Currently Amazon Web Services and DigitalOcean are supported. The generated images will have a grist
user that is mostly setup to run Grist via Docker Compose.
Follow these steps to build AMIs for AWS and Snapshots for DigitalOcean (DO).
- Install Packer
- Clone this repository:
git clone https://github.com/gristlabs/grist-pack.git
- Initialise packer:
cd grist-pack && packer init .
You now need to obtain credentials for AWS and DO.
- For AWS, you need to obtain an access key with its corresponding secret.
- For DO, you will need a token
Create a file called grist.auto.pkrvars.hcl
and add those secrets. For example:
echo '
aws_access_key = "XXXXXXXXXXXXXXXXXXXX"
aws_secret_key = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"
do_token = "dop_v1_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
' > grist.auto.pkrvars.hcl
You are now ready to build the images:
packer build .
This should take a few minutes and generate in parallel two images, one for AWS and one for DO. Both images will be named grist-marketplace-${timestamp}
. If it completes successfully, it will write the resulting IDs of each image to a manifest.json
file in the local directory. You can now go into your AWS console to inspect the resulting AMI or to your DO dashboard and see the new snapshot. You may further launch virtual machines as normal via the usual means for each cloud provider.
The Packer configuration can be found in the grist.pkr.hcl
file. Two variables are defined there for choosing the base image and for generating the AMI or snapshot: aws_image_filter
and do_image
– for AWS and DO, respectively. These variables can be overridden via the usual method for Packer variables in order to pick different base images to build from.
For DO, note that scripts/digitalocean-img-check
, a linting script, has a hardcoded list of allowed base images. This script should be updated from its upstream source whenever DO updates the allowed list.